Computer immediately turns back on after "Shut Down" or holding power button, after editing registry

1

I have 4 PCs which I'm 'setting up' ready for a client. I created a batch script to set a load of values which need setting so that I can save time by not having to do it manually. (See batch script below)

However, since running this script, I cannot shut down the computers..(well, a couple of them, not all of them). By going using Alt+F4 > Shutdown, the computer "shuts down" and then immediately turns back on again. Please note, all that happens is the screen goes blank and then 3 seconds later comes on again, as if you put it to sleep and immediately pushed a key on the keyboard. It doesn't go through the whole boot procedure.

The same happens if I hold down the power button for 5 seconds - the screen goes blank and then 3 seconds later comes on again.

If you could tell me what I might have done wrong and how I can fix it, I would be most grateful!


REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v ExtendedUIHoverTime /t REG_DWORD /d 300000 /f
REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "" /f
REG ADD "HKEY_CURRENT_USER\Control Panel\Colors" /v Background /t REG_SZ /d "0 0 0" /f
REG ADD "HKEY_CURRENT_USER\Control Panel\PowerCfg" /v CurrentPowerPolicy /t REG_SZ /d 4 /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoUpdate /t REG_DWORD /d 1 /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList /v DefaultMediaCost /t REG_DWORD /d 2 /f

[2:16] REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList /v DefaultMediaCost /t REG_DWORD /d 2 /f

I am aware that one of the lines in the batch file is erroneous - the last line is accidentally trying to set the value of the path, rather than a key...which is of course impossible. Also, you'll notice that the key path is not surrounded by quotes even though it has a space in it.

Ben Hayward

Posted 2017-04-24T13:19:11.667

Reputation: 129

You will have to test each line in your script to determine which line is causing the problem, of course none of those lines, would cause the problem you describe so I suspect you will confirm that fact when you debug the script. – Ramhound – 2017-04-24T13:39:43.807

No answers