Ikelca
asked on
make windows automatically restart
hi all
what i am looking for is that having computer restart one more time automatically after I manually restart it at beginning. That way i dont have to wait there to do second restart manually.
I am ok with c# or batch file or adding registry
thanks
what i am looking for is that having computer restart one more time automatically after I manually restart it at beginning. That way i dont have to wait there to do second restart manually.
I am ok with c# or batch file or adding registry
thanks
Create batch file containing 'shutdown /r'
ASKER
that is not what I am looking for
because I have to logon to start batch file
I want no touch after first reboot
because I have to logon to start batch file
I want no touch after first reboot
Use HKEY_LOCAL_MACHINE\SOFTWAR E\Microsof t\Windows\ CurrentVer sion\RunOn ce to point to script
1-Create a LocalPolicy or a Computer Group Policy Object to run an AutoRestart batch file at computer startup.
GPO AutoRestart.bat:
If exist "C:\Temp\AutoRestart.txt" (
del /f /q "C:\Temp\AutoRestart.txt"
shutdown -f -r -t 1
)
Batch File to restart PC then, auto restart it (Because of the GPO):
ECHO. >"C:\Temp\AutoRestart.txt"
shutdown -f -r -t 1
GPO AutoRestart.bat:
If exist "C:\Temp\AutoRestart.txt" (
del /f /q "C:\Temp\AutoRestart.txt"
shutdown -f -r -t 1
)
Batch File to restart PC then, auto restart it (Because of the GPO):
ECHO. >"C:\Temp\AutoRestart.txt"
shutdown -f -r -t 1
@Govvy:
User will require to logon so that the run once takes effect. This defise the purpose of not waiting for the PC to boot before rebooting.
User will require to logon so that the run once takes effect. This defise the purpose of not waiting for the PC to boot before rebooting.
ASKER
RUNONCE key require logon to run whatever inside
i have tried that already.
regarding GPO, it may work, but how can I use c# to create a new GPO? that's the question, isn't GPO linking to registry?? if that's the case, which key in registry?
i have tried that already.
regarding GPO, it may work, but how can I use c# to create a new GPO? that's the question, isn't GPO linking to registry?? if that's the case, which key in registry?
ASKER
ok this works ReneGe,
but it leaves GPO enabled, is there way to disable that after run?
but it leaves GPO enabled, is there way to disable that after run?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
let me try and get back to u
ASKER
thanks guys, i decided to use scheduled task to run shutdown.exe
Glad I could help.