NT4 - Shuting down and restarting the server NT4 - Shuting down and restart the server
#1
Posted 29 December 2012 - 04:42 PM
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 time
Thank you in advance,
Amos
#2
Posted 04 January 2013 - 12:39 AM
I don't have the NT4 RK shutdown.exe easily accessible but I think the parameters may be the same as NT4
from 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. Caution
If 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.
#3
Posted 04 January 2013 - 06:19 AM
am12348, on 29 December 2012 - 04:42 PM, said:
Here:
Quote
(without the need to use the Resource Kit)
http://www.robvander...mb_rebootnt.php
jaclaz
#4
Posted 06 January 2013 - 02:37 PM
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 does
shut 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
#5
Posted 06 January 2013 - 02:43 PM
This post has been edited by am12348: 06 January 2013 - 02:45 PM
#7
Posted 07 January 2013 - 03:17 PM
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 to
know, if there a way to put an additional parameter besides the "interactive", that tells the
system, 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
#8
Posted 08 January 2013 - 11:02 PM
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've
put 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 a
user has not to be near the server at that time.
Is there an additional parameter besides the "interactive" parameter "number of seconds
to wait" "so that the server executess the command in "at" automatically if no one gives
any response?
Thank you for your answers,
Amos
#9
Posted 13 January 2013 - 04:42 PM
As I've specified the previous topocs I've a problem in "at" comans - The associated command
does not take effect when the schedule time cones, even though the schediler service has
been starsed.
I've heard , that in order that "at" will take effect , an additional service besides the scheduler
task has to be started by an administrator.
Does anyone know the name of that setvice?
Thank you,
Amos
#10
Posted 26 January 2013 - 02:29 PM
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.bat
When the time comes, the server sounds a "beep", but it seems that the batch is not activated
When I write in the cmd screen
at 07:00 /interactive /every:Su,M,T,W,TH,F c:\temp\restart.bat
When the time comes, the server displays a message about istallation error. The batch
is 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
#11
Posted 26 January 2013 - 03:30 PM
http://www.computing...-nt-/14540.html
Get it here (maybe)
http://www.hpcfactor...s/msie/ie55sp2/
Or find links here (better)
http://www.mdgx.com/ietoy.htm#IE55
Not 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 well
http://computerplumb...scheduled-task/
HTH
This post has been edited by submix8c: 26 January 2013 - 03:33 PM
#12
Posted 26 January 2013 - 08:53 PM
Cheers and Regards
#13
Posted 30 January 2013 - 11:03 PM
As far as I've checked, the "schedule" service is running.In the NT4 server, I've gone to the control panel and
under "services" I've seen that "schedule" is active
#14
Posted 31 January 2013 - 08:07 AM
Here there are some good tips on what to add to the batch to troubleshoot/debug:
http://www.robvanderwoude.com/ntat.php
jaclaz
#15
Posted 31 January 2013 - 01:30 PM
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}.inf
echo [defaultinstall] >> {out}.inf
rundll32 setupapi,%inf% 1 %temp%\{out}.inf
del {out}.inf
If I activate the batch without "at" , it is working as expected.
However if I put in in "at", when time comes, a beep is sound
and the batch does not work
I 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
#16
Posted 31 January 2013 - 01:36 PM
As far as I know, there is not "Schedulrd Task" under Control Panel"
Following to the replies in the forum, I've done the following:
- I've written a batch file, which shuts down the NT4 server and restarts it
- I've verified that the schedule service is active
- I've define a new "at" activity in such way:
at 07:00 /every:Su,M,T,W,TH,F c:\winnt\system32\cmd.exe /q /c c:\temp\restart.bat
When I write "at": in the command prompt, I see a new id with the one I've defined
Now, when the time comes,I hear a beep but the at does not take efffect
I've written the same, but with the parameter interactive
at 07:00 /interactive /every:Su,M,T,W,TH,F c:\winnt\system32\cmd.exe /q /c c:\temp\restart.bat
When the time comes, the server displays a message about istallation error. The batch
is not activated.
When I write another activity for example "notepad"
at 07:00 /interactive /every:Su,M,T,W,TH,F notepad
The notepad window is displayed, when the time comes
If I write simply "c:\temp\restart.bat", the batch works as expected - It shuts down the server and restarts it
Does anyone have an idea what can I do, is there an alternative way, any function, to schedule the batch?
Is there an alternative way, any function, to schedule the batch file?
Thank you in advance,
Amos
#17
Posted 31 January 2013 - 02:04 PM
Quote
Just schedule CMD.EXE to be started, using AT.EXE's /INTERACTIVE switch to make the CMD prompt visible
Now execute the command in the resulting CMD prompt and see if the access rights are sufficient for the task you intend to schedule
Check the current directory; is it the same directory you used for testing the command?
It is best to use fully specified paths instead of relying on PATH variables that may change every now and then or even be different for different user IDs
Check if you can access remote systems, if that's necessary for the task to be scheduled; many scheduled COPY commands to remote systems fail because the SYSTEM account cannot access remote network drives
Check if the necessary drive mappings are available in this CMD prompt
Check the environment variables; are they identical to your own environment variables?
Remember, this CMD prompt is the exact environment that your scheduled command will be using
It is possible that there are access rights issue (IMHO the most likely, but cannot really say).
It could be an issue when writing the temporary "out" file or when actually executing it through rundll32 setupapi.
Do exactly the steps listed above, and report what happens/which step fails.
At first sight there is nothing "wrong" in the batch, I would personally write it slightly differently:
@ECHO OFF
PUSHD %temp%
set inf=InstallHinfSection DefaultInstall
::SET
::PAUSE
(
echo [version]
echo signature=$chicago$
echo [defaultinstall]
)>{out}.inf
:: TYPE {out}.inf
::PAUSE
rundll32 setupapi,%inf% 1 %temp%\{out}.inf
::PAUSE
del {out}.inf
POPD
but it shouldn't make a difference (to test remove the :: in front of the lines to pause and show what is happening).
jaclaz
P.S: : I am not too sure that grouping with brackets is supported in NT 4, if it doesn't work revert to plainer:
echo [version]>{out}.inf
echo signature=$chicago$>>{out}.inf
echo [defaultinstall]>>{out}.inf
This post has been edited by jaclaz: 31 January 2013 - 02:08 PM
#19
Posted 31 January 2013 - 03:30 PM
#20
Posted 31 January 2013 - 05:29 PM
Post #10 says IE6SP1 (should work fine)
Post #2 says Minimum/Recommended IE5.5SP2 (see link)
Install one or the other. Task Scheduler will appear in Control Panel.
Also see LAST link in Post #2 for "How To" in Task Scheduler. A slight "trick". Fairly simple.
Quote
In fact this scenario has me confused.
Quote
Quote
Another reference to RUNDLL32 also from Rob -
http://www.robvander....com/rundll.php
AAAAAND the INF/BAT in question is ALSO referenced by Rob (scroll down) -
http://www.robvander...om/shutdown.php
Your PROBLEM is putting the INF into a BAT/CMD and causing it to SCHEDULE.
Combine the Partial Solutions listed.
1 - Install IE5.5SP2/IE6SP1 (see references)
2 - Create the BAT file (see refrences)
3 - Scheduler the CMD in Task Scheduler to Run the BAT (see references)
Done!
Note: I'm really unsure if you will need some kind of Delay somewhere to allow for Scheduled CMD Exit. You should PROBABLY use "START /WAIT xxxx.BAT"(?). Maybe an "EXIT" need put in the end of the BAT(?).
http://ss64.com/nt/cmd.html
Quote
http://www.robvander...com/ntstart.php
This post has been edited by submix8c: 01 February 2013 - 07:34 AM



Help

Back to top










