0

I have Windows 7 Professional. I was moved here from Stackoverflow. I wrote a file called spegnimento.bat with the following content:

case 1: shutdown /f

case 2: shutdown -f

case 3: shutdown /s

case 4: shutdown /l

If I save the file, close it, and then click it, I have the following results:

1) all files and programs are closed, then I'm logged off from Windows

2) same as 1)

3) all files and programs are closed, then the pc is shut down

4) same as 1)

However, if I ask the task scheduler to open the spegnimento.bat files at 6.35 pm, at that time I obtain the following results:

1) none

2) same as 1)

3) warning: the pc will be shut down in a minute. Then all files and programs are closed, and the pc is shut down

4) same as 1)

Question: Why do my clicks and the task scheduler have different results with same .bat files?

  • Try running it as Adminstrator or as System, and check the behavior. – DrMoishe Pippik Nov 8 at 18:25
  • With "shutdown /f" or "shutdown -f" you don't seem to give the command any instructions on what to do. "F" only means (force) you have to give more instructions for exemple: shutdown -s -f (force shutdown) shutdown -r -f (force restart) shutdown -h -f (force hibernation) shutdown -l -f (force logoff). – Ricardo Bohner Nov 9 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.