Created
August 5, 2010 03:48
-
-
Save tathamoddie/509197 to your computer and use it in GitHub Desktop.
Batch file to automatically detect, download and install PowerShell 2 on to an XP SP3 machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Originally from http://blog.codeassassin.com/2009/12/10/no-web-browser-need-powershell/ | |
echo class Program { public static void Main() { >"%~dpn0.cs" | |
echo using (var wc = new System.Net.WebClient()) { >>"%~dpn0.cs" | |
echo wc.DownloadFile(@"http://download.microsoft.com/download/1/1/7/117FB25C-BB2D-41E1-B01E-0FEB0BC72C30/WindowsServer2003-KB968930-x86-ENG.exe", @"%~dpn0.installer.exe");}}} >>"%~dpn0.cs" | |
"%systemroot%\microsoft.net\framework\v3.5\csc.exe" /out:"%~dpn0.exe" "%~dpn0.cs" | |
"%~dpn0.exe" | |
"%~dpn0.installer.exe" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment