Creating an USB stick that completes the Windows 10 wizard

27 Views Asked by At

So where I worked before we had a USB that you could plug into a desktop that was at the start of the W10 wizard and it would complete the wizard as soon as you plug it in.

Now at my new job we don't have that so I wanted to create one since I need to do it for a lot of desktops. I tried googling it but without result. I saw a lot of tutorial on how to create the unattended.xml file that could fix that but it looks like that is used for devices that still need installation. However these devices are already installed and only need to complete the wizard.

I've tried to make a batch file and enable it with autorun however when plugging it in nothing seems to happen.

setup.ps1

Start-Process -FilePath "C:\Windows\System32\oobe\setupsq.exe" -ArgumentList "/unattend" -Wait

Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
[System.Windows.Forms.SendKeys]::SendWait("{TAB}{TAB}{ENTER}")
[System.Windows.Forms.SendKeys]::SendWait("myusername")
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
[System.Windows.Forms.SendKeys]::SendWait("mypassword")
[System.Windows.Forms.SendKeys]::SendWait("{TAB}{ENTER}")

autorun.inf

[Autorun]
open=powershell.exe -ExecutionPolicy Bypass -File automate-setup.ps1
action=Run PowerShell Script
icon=powershell.exe,0

I've tried to do it through powershell however when plugging it in on a device nothing happens, tested it on my laptop as well but nothing seem to be happening there either. What's expected is that as soon as you plug in the USB it clicks on enter, tab, tab, enter, enters username, tab, enters password, tab, enter.

Also if there is another way to do this that would be fine to without having to simulate keyboard clicks.

0

There are 0 best solutions below