Help with batch file

BokehBokeh Member Posts: 1,636 ■■■■■■■□□□
We have some laptops that we would like to shut down at 11pm every evening. Ive done a simple batch file to shut things down and run as a scheduled event. However, I need the file to also answer a question.

See when the computer is being rebooted, manually shut down, etc one of our processes comes up and asks "ok to terminate batch file yes/no". I need to find a way to get the shutdown file to say yes.

Right now the file simply states "shutdown -s t- 0"

Any ideas?

Comments

  • tierstentiersten Member Posts: 4,505
    Change the 0 to 5. It will shutdown after 5 seconds and the batch should have finished by then.
  • tierstentiersten Member Posts: 4,505
    I'm assuming that you've actually got "shutdown /s /t 0" in your batch file...
  • BokehBokeh Member Posts: 1,636 ■■■■■■■□□□
    Thanks but that didnt work. Still comes up with ok to terminate batch file. I'll keep digging on this.
  • dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    On my Vista machine, it says that /t implies /f, but I don't see that here for the older command. Maybe try adding a /f.
  • BokehBokeh Member Posts: 1,636 ■■■■■■■□□□
    The file in question is outlookrestart.exe. It keeps outlook open for the employees so they don't shut it down and forget to check their emails. I think I need to stop this process first, then do the shutdown. All of this on XP pro.
  • tierstentiersten Member Posts: 4,505
    How about doing "start shutdown /s /t 5"
  • BokehBokeh Member Posts: 1,636 ■■■■■■■□□□
    Nope same thing. Goes to shutdown, then I get the message ok to terminate batch file yes/no. If I dont respond, then I get another message saying system cannot end this program because it is awaiting a response from you.
  • dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Bokeh wrote: »
    The file in question is outlookrestart.exe. It keeps outlook open for the employees so they don't shut it down and forget to check their emails. I think I need to stop this process first, then do the shutdown. All of this on XP pro.

    Maybe try this: PsKill v1.12
  • BokehBokeh Member Posts: 1,636 ■■■■■■■□□□
    I think I got it finally.

    Close outlookrestart
    tskill outlookrestart
    shutdown -s -t 5
Sign In or Register to comment.