PowerShell and System start (bottom)

Source: Internet
Author: User
Tags ftp site

First, let's look at the PowerShell code that configures the IP address

$wmi =get-wmiobject-class win32_networkadapterconfiguration-filter ipenabled=true-computername. # Set the IP address and subnet mask $wmi. EnableStatic (' 192.168.0.100 ', ' 255.255.255.0 ') # Sets the Gateway $WMI. SetGateways (' 192.168.56.254 ') # Set the DNS$WMI. SetDNSServerSearchOrder (' 192.168.70.1 ')

Then this piece is to write the data to die in the inside, we can use read-host and variable way input, concrete method can refer to my previous article, example many. This piece of advice is inserted into the front of the opening script, because the next step is to add a field.


Another point is that you can also write cmd to import a reg file for quick configuration of Windows hosts.


As we all know, PowerShell script Ps1 file is not able to quickly double-click with the administrator to run, this How to solve it?

We use CMD to solve, create a cmd file

Echo OFFC:CD MD adscriptcd Adscriptecho open Cloud.it>ftptmpecho Anonymous>>ftptmpecho ad>>ftptmpecho Get 7z.exe>>ftptmpecho get 7z.dll>>ftptmpecho get Hvkj.zip>>ftptmpecho quit>>ftptmpftp-s: Ftptmprem cls7z x hvkj.zip copy *.lnk C:\users\public\desktop/ypowershell set-executionpolicy remotesigned

The above sentence is to download files from a local FTP site, to a local specific location, and then release, the shortcuts are released to the desktop, of course, can also be downloaded and run.

Both the download cmd and the run cmd can be directly double-clicked, so the problem is clear.

→→→ make a shortcut, open with admin, run PowerShell from cmd

Still is the cmd mixed write, the concrete view, with the CMD mixed writes the characteristic is, can quickly close the service and runs the registry. Above

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/92/wKioL1VMcLXQMmHLAAPeDJox_Ko714.jpg "title=" 2015-5-8 16-07-21.jpg "alt=" Wkiol1vmclxqmmhlaapedjox_ko714.jpg "/>


This article is from the "Nine uncle-Microsoft Private Cloud" blog, please make sure to keep this source http://jiushu.blog.51cto.com/972756/1649637

PowerShell and System start (bottom)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.