| 1. |
Solve : Two questions about Auto Shutdown code? |
|
Answer» Hi, I has questions about the auto shutdown thing in command prompt, so if you'd please be kind enough to answer em, that'd be grand For a batch file, use this: It doesn't work when you put it in a batch file and try to OPEN it. It just repeatadly displays the code.Quote from: Dark Blade on April 20, 2007, 07:55:48 PM It doesn't work when you put it in a batch file and try to open it. It just repeatadly displays the code. What do you mean by "displays the code"? Do you mean loading it into notepad? Are you double clicking the batch file? How do you normally run batch FILES? This is what I use to shut down my computer. I have been using it every day for about 2 years in a batch file. Works every time. No quotes around the time parameter either. Actually I always use the .cmd extension rather than .bat these days to get the advantages of Windows XP's cmd.exe. i wonder if this makes a difference? Code: [Select]shutdown -s -t 01 -c Code: [Select]shutdown -s -t 01 -c You don't actually need to have -c (that displays a MESSAGE). But it might work differently in .cmd. Nope. I tried that, it does that same as .bat. Quote What do you mean by "displays the code"? Do you mean loading it into notepad? Are you double clicking the batch file? How do you normally run batch files?I save the code as a batch file, and when I open it (double click), displays: Code: [Select]shutdown -s -t 30 shutdown -s -t 30 shutdown -s -t 30 shutdown -s -t 30 shutdown -s -t 30 shutdown -s -t 30 And just says that a lot. Just to make sure, are you typing the code in notepad, saving it to the desktop as name.bat and double clicking 'name.bat' ?Quote from: Dark Blade on April 21, 2007, 05:55:59 PM You don't actually need to have -c (that displays a message). But it might work differently in .cmd. I accidentally cut off the rest of the line. It should read shutdown -s -t 01 -c "System closing down!" Quote I accidentally cut off the rest of the line. It should readOK. Quote Just to make sure, are you typing the code in notepad, saving it to the desktop as name.bat and double clicking 'name.bat' ? Yep. I do that, and it does exactly what I said before (even if I save it as .cmd, not .bat).A long shot... http://www.aumha.org/win5/a/shtdwnxp.php In fact that page is full of shutdown problem tips. It seems a shutdown batch file can hang sometimes for example as here, but there are other causes. Google for "shutdown batch hangs" Quote USING SHUTDOWN SCRIPTS & 802.1x AUTHENTICATION PROTOCOL. This combination can cause Win XP to take in excess of 10 minutes to shutdown normally. (IEEE 802.1x is an authentication standard for both wireless networks and wired Ethernet networks.) Here’s how the dominoes fall: The 802.1x authentication protocol stops after the user logs off. Shutdown scripts run after the user logs off. If the script is on a network share and the connection is no longer available (since authentication has terminated), the script can’t run. The default time-out for shutdown scripts is 10 minutes. So the computer sits there 10 minutes before continuing with its shutdown. Anyone know how to give said batch file a trigger, such as when a specified file is accessed? All, Try using the following to shutdown Windows XP from an MS-DOS batch file:- start shutdown.exe -s -f -t 0 Works for me. Hope that helps, James |
|