am12348 Posted December 29, 2012 Posted December 29, 2012 Hello everybody, I would like to if there is a statement I can write in the command window that shuts down the server and restarts it. I was told that I can use the following command. However, when I tried Inothing happened Under c:\winnt\system32 rundll32.exe shutdown /1 /y /r My purpose is to add the cmd to a batch file which is scheduled on a certain timeThank you in advance,Amos
angmor Posted January 4, 2013 Posted January 4, 2013 Different versions of Windows use different parameters for shutdown.exeI don't have the NT4 RK shutdown.exe easily accessible but I think the parameters may be the same as NT4from the W2K resource kit, shutdown.exe:shutdown /l /r /y /c/l Specifies a local shutdown. (note that the parameter is the lower case letter L)/r Restart the computer specifed after shutdown./y Answers questions with "yes"./c Forces running applications to close. CautionIf you use the /c parameter, Windows 2000 ignores the application's option to save data that might have changed. You will see no File Save dialog box, because Windows 2000 will force the application to close. This will result in a loss of all data not previously saved.Other parameters:\\computername Specifies the remote computer to shut down. If no name is given but the tool is started with any of the other options, the local computer name will be used./a Quits a system shutdown. This can only be done during the timeout period. If this switch is used, all others are ignored./t:xx "msg"Sets the timer for system shutdown in xx seconds. The default is 20 seconds."msg" Specifies an additional message with a maximum of 127 characters, surrounded by quotation marks./? (or shutdown without parameters) display help.
jaclaz Posted January 4, 2013 Posted January 4, 2013 I would like to if there is a statement I can write in the command window that shuts down the server and restarts it.Here:Reboot Windows NT(without the need to use the Resource Kit)http://www.robvanderwoude.com/amb_rebootnt.phpjaclaz
am12348 Posted January 6, 2013 Author Posted January 6, 2013 Hello everybody, For a certain reason I want to shut down and restart the NT4 at a certain hour on specific dates.I wrote in the command screen:at 07:15 /every:Su,M,T,W,TH,F restartNT4 restartNT4 is a private batch file. I have not found an appropriate command in NT4, that doesshut down and restart.When I types the statement at, I've seen this command in the list.However, when the specified time comes in the appropriate days in week, nothing happens.Does anyone have an idea, what is wrong.When I type the command-the name of the batch file regularly - The server shuts down and restarts.Thank you,Amos
am12348 Posted January 6, 2013 Author Posted January 6, 2013 (edited) Thank you for your replies they helped me Edited January 6, 2013 by am12348
allen2 Posted January 6, 2013 Posted January 6, 2013 (edited) You might need to put the full path name of the batch. You could also use the psshutdown command from the pstools with the right user. Edited January 6, 2013 by allen2
am12348 Posted January 7, 2013 Author Posted January 7, 2013 ]Hello, First of all thank you. Secondly, I've specified the scheduled command in a full path. However the situation is the same - the "at " command does not take effect. I've even put the full command in quotes. However, if I specify the "interactive" parameter, the "at" then stops at the scheduled time and waits, the user to put something. I want to use the "interactive" parameter to solve my problem. Therefore I would like toknow, if there a way to put an additional parameter besides the "interactive", that tells thesystem, that if there is not any response from the user for a certain time, the command associated to the "at" is done.Thank you, Amos
am12348 Posted January 9, 2013 Author Posted January 9, 2013 Hello,As I've written before, I've met a problem in "at" cpmmand in our NT4. The command does not take effect when the scheduled time comes.I've specified the full path, I'veput the command in quotes. It didn't help.However, if I specify the "interactive" parameter, the "at" then stops at the scheduled time and waits the user to put something. ThereforeI want to try to use the "interactive" parameter to solve my problem, but auser has not to be near the server at that time.Is there an additional parameter besides the "interactive" parameter "number of secondsto wait" "so that the server executess the command in "at" automatically if no one givesany response?Thank you for your answers, Amos
am12348 Posted January 13, 2013 Author Posted January 13, 2013 Hello, As I've specified the previous topocs I've a problem in "at" comans - The associated commanddoes not take effect when the schedule time cones, even though the schediler service hasbeen starsed. I've heard , that in order that "at" will take effect , an additional service besides the schedulertask has to be started by an administrator. Does anyone know the name of that setvice?Thank you, Amos
am12348 Posted January 26, 2013 Author Posted January 26, 2013 Hello, Thank to anyone that will help me to overcome this problem: I've write a batch file that shuts down and restarts the NT server. I've put it in the C: drive in the NT. When I activate the batch in the cmd screen, it shuts down and restarts the server as espected. I want to activate the batch at a specific time. Therefore I try to use the function "at": I write in the cmd screen:at 07:00 /every:Su,M,T,W,TH,F c:\temp\restart.batWhen the time comes, the server sounds a "beep", but it seems that the batch is not activatedWhen I write in the cmd screenat 07:00 /interactive /every:Su,M,T,W,TH,F c:\temp\restart.batWhen the time comes, the server displays a message about istallation error. The batchis not activated.What is wrong with what I've written?Is there an alternative way, any function, to schedule the batch file?Thank you Amos
submix8c Posted January 26, 2013 Posted January 26, 2013 (edited) Hmmm -http://www.computing.net/answers/windows-nt/how-to-schedule-a-task-in-nt-/14540.htmlGet it here (maybe)http://www.hpcfactor.com/downloads/msie/ie55sp2/Or find links here (better)http://www.mdgx.com/ietoy.htm#IE55Not sure if using "Task Scheduler" will work out better than "AT" or not.edit - It appears that using a BAT directly may not work? Look at this as wellhttp://computerplumber.com/2009/01/run-a-batch-file-as-a-scheduled-task/HTH Edited January 26, 2013 by submix8c
bphlpt Posted January 27, 2013 Posted January 27, 2013 I noticed that it says that the "schedule" service must be running for the "AT" command to work correctly. Is your "schedule" service running?Cheers and Regards
am12348 Posted January 31, 2013 Author Posted January 31, 2013 Hello, As far as I've checked, the "schedule" service is running.In the NT4 server, I've gone to the control panel andunder "services" I've seen that "schedule" is active
jaclaz Posted January 31, 2013 Posted January 31, 2013 Post the contents of the actual .bat (which BTW should really be a .cmd)Here there are some good tips on what to add to the batch to troubleshoot/debug:http://www.robvanderwoude.com/ntat.phpjaclaz
am12348 Posted January 31, 2013 Author Posted January 31, 2013 Hello, Here there is the content of the batch I use:@ECHO OFF & cd/d %temp% & echo [version] > {out}.inf(set inf=InstallHinfSection DefaultInstall)echo signature=$chicago$ >> {out}.infecho [defaultinstall] >> {out}.infrundll32 setupapi,%inf% 1 %temp%\{out}.infdel {out}.infIf I activate the batch without "at" , it is working as expected.However if I put in in "at", when time comes, a beep is soundand the batch does not workI write the "at" as follows:at 07:00 /interactive /every:Su,M,T,W,TH,F c:\winnt\system32\cmd.exe /q /c c:\temp\restart.bat
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now