Page 1 of 1

Shutdown.exe Fails?

Posted: 15 Feb 2011 09:34
by Dos_Probie
The below batch works in turning off the UAC and says "The operation completed successfully" then just stops there and won't do the shutdown command. I am sure it something simple that I am overlooking but any help would be most appreciated. P.S. also specified dos color will not work as well... :(



@echo off&setlocal&color 0c&mode con: cols=75 lines=20
title [ Disable User Account Control - Windows 7 ]

:Suppress UAC consent prompt dialog to "Never notify"
"%windir%\system32\cmd.exe" /k "%windir%\system32\reg.exe add hklm\software\microsoft\windows\currentversion\policies\system" /v EnableLUA /t reg_dword /d 0 /f
"%windir%\system32\cmd.exe" /k "%windir%\system32\reg.exe add hklm\software\microsoft\windows\currentversion\policies\system" /v ConsentPromptBehaviorAdmin /t reg_dword /d 0 /f

shutdown.exe -f -r -t 0&endlocal&exit

Re: Shutdown.exe Fails?

Posted: 15 Feb 2011 12:09
by aGerman
Why do you use "%windir%\system32\cmd.exe" /k ?
This should work:

Code: Select all

reg add "hklm\software\microsoft\windows\currentversion\policies\system" /v EnableLUA /t reg_dword /d 0 /f

Regards
aGerman

Re: Shutdown.exe Fails?

Posted: 15 Feb 2011 16:39
by Dos_Probie
Thanks! aGerman that did the trick , also noticed if I used the /c switch instead of the /f that it would contintue on then reboot ..