Easy Windows 7 upgrade script
Automating repetitive or time-consuming tasks is one of the cornerstones of good systems administration and anyone can take advantage of automation. Even the looming need to upgrade from Windows 7 to Windows 10 can be taken from pretty straightforward to dead simple with the help of a little scripting.
This script uses Microsoft Powershell to get the job done which has been a part of Windows since Windows 7 Service Pack 1 so chances are that your Windows 7 powered system is ready to go.
This tip comes from LifeHacker (awesome place for tips)
- Get started:
Click on the Start button, type in Powershell, right-click on “Windows Powershell,” and select “Run as Administrator.”
- As a security measure, PowerShell is set to not run scripts by default until you change a certain registry key. To do that, type this into Powershell and hit Enter when you’re done:
- Close PowerShell and you are ready to move on to the next step.
This bit we will either download the script or write it ourselves.
(If you are pressed for time and trusting, you can skip this step and use this link to download the zip file direct from my website – https://benaylett.com/wp-content/uploads/2020/01/windows7_upgrade_to_10.zip)
Open your favourite text editor (or Notepad.exe) and copy the following into the editor and save to your desktop. Make sure that you save the file as a .PS1 instead of .txt to make it possible for Powershell to execute the script.
$dir = “c:\temp”
$webClient = New-Object System.Net.WebClient
$url = “https://go.microsoft.com/fwlink/?LinkID=799445”
$file = “$($dir)\Win10Upgrade.exe”
Start-Process -FilePath $file -ArgumentList “/quietinstall /skipeula /auto upgrade /copylogs $dir” -verb runas
The line beginning with Start-Process is the last line so if it looks like there is another line below it, it is actually the tail end of the Start-Process command.
Now we put it to work by right clicking on the file we created (or downloaded) and select “Run with PowerShell” followed by confirming that you want the script to make changes to your computer (the answer is by the way yes).
This process will continue in the background and will take a while. You know you will be ready for the last few clicks when you see the Microsoft Software License Terms.
Simply click to go through the last few questions and there you go. Windows 10.
Free, Legal and safe.
It is a good idea now to lock down PowerShell now that we no longer need to run scripts willy-nilly.
- Click on the Start button, type in Powershell, right-click on “Windows Powershell,” and select “Run as Administrator.”
- Type this into Powershell and hit Enter when you’re done:
- Close PowerShell and you are ready to explore your newly upgraded system.