Sign in to follow this  
Followers 0
am12348

NT4 - Shuting down and restarting the server

45 posts in this topic

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 time

Thank you in advance,

Amos

0

Share this post


Link to post
Share on other sites

Different versions of Windows use different parameters for shutdown.exe

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.

0

Share this post


Link to post
Share on other sites

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 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

0

Share this post


Link to post
Share on other sites

Thank you for your replies they helped me

Edited by am12348
0

Share this post


Link to post
Share on other sites

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 by allen2
0

Share this post


Link to post
Share on other sites

]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 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

0

Share this post


Link to post
Share on other sites

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'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

0

Share this post


Link to post
Share on other sites

Hello,

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

0

Share this post


Link to post
Share on other sites

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.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

0

Share this post


Link to post
Share on other sites

Hmmm -

http://www.computing.net/answers/windows-nt/how-to-schedule-a-task-in-nt-/14540.html

Get it here (maybe)

http://www.hpcfactor.com/downloads/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://computerplumber.com/2009/01/run-a-batch-file-as-a-scheduled-task/

HTH

Edited by submix8c
0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

Hello,

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

0

Share this post


Link to post
Share on other sites

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}.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

0

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.