ripigs Posted January 21, 2008 Share Posted January 21, 2008 I am trying to loop shutdown so the user does not shutdown/restart the computer during the install process, then I need it to stop the shutdown loop after the CMD/BAT is done doing what I want it to do.@echo off:loopshutdown -aping 127.0.0.1 -n 00 >nulgoto :loop+++++++++Then all my other CMD'safter that+++++++++Just need some help!! Link to comment Share on other sites More sharing options...
jaclaz Posted January 21, 2008 Share Posted January 21, 2008 What I would do in the batch:1) Issue a shutdown.exe -a2) Rename shutdown.exe to shutdown.NOP (or whatever)3) Execute rest of the batch4) Rename shutdown.NOP back to shutdown.exejaclaz Link to comment Share on other sites More sharing options...
ripigs Posted January 24, 2008 Author Share Posted January 24, 2008 Thanks, I gave it a try but windows just put shutdown back into the system32 folder.But just placing the===shutdown -a ===should do the job. Link to comment Share on other sites More sharing options...
Yzöwl Posted January 24, 2008 Share Posted January 24, 2008 My understanding is that `shutdown -a` will abort a running shutdown procedure. It appears that you are wanting to prevent one from being issued, which is not the same. I would doubt that having a looping abort switch would be an efficient method of stopping a new shutdown procedure from being invoked. Apart from that the commands at the bottom of your batch file will never get issued since the loop will never end. You could to look at opening another console session using a defined windows title which runs the loop, running your commands in the original session ending with a command to close the looping batch using its windows title.You may be able, as jaclaz already suggested, to simply rename shutdown.exe, (after preventing WFP from `fixing` it) but to be honest there's nothing to stop users from pushing the button on the front of the PC anyhow.Also you say install process, what are you installing, it sounds as if you are trying to install something unattendedly for other users which must take some time and over which you'd like to have more control.My suggestion, whether you like it or not, is to have a little faith in your end users, pop up a message letting them know of the install procedure and that switching off will likely render their computer useless. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now