Share via

The "shutdown" command isn't functioning properly

Anonymous
2010-05-30T09:55:50+00:00

I'm trying to write a batch file to automate a log off, but if I use the /t switch the command prompt will print the Usage (i.e. as if I typed "shutdown" or "shutdown /?" into the command prompt) and then quit without initiating a log off. I have confirmed this by typing the line "shutdown /a" into the command prompt after attempting a shutdown with the /t switch (I've tried both 0 and 1), which results in the message "Unable to abort the system shutdown because no shutdown was in progress.(1116)"

I can use the line "shutdown /l" and it will work just fine, but when I log back on I notice that any new or moved icons will be in the upper-left corner of the desktop (i.e. not where I put them).

I have also noticed that the Usage (shutdown /?) explains that if the /t switch is not set (I'm assuming this, as the literal text reads "..., with a default of 30.") the log off will be initiated, but not executed until 30 seconds after the shutdown command is resolved. Yet, if I simply use "shutdown /l" the current user is logged off immediately.

Windows for home | Previous Windows versions | Windows update

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-06-02T21:50:48+00:00

Josh,

Thank you for visiting the Microsoft Answers Community site. The issue you posted is related to Scripting and would be better suited in the The Official Scripting Guys Forums community. Please visit the link below to find a community that will offer the support you request:

http://social.technet.microsoft.com/Forums/en/ITCG/threads/


Cody C

Microsoft Answers Support Engineer

Visit our Microsoft Answers Feedback Forum and let us know what you think.

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-05-30T10:12:48+00:00

    Using "shutdown /l /d c" has the same effect as using the /t switch. Even using "shutdown /l /d" will yield exactly the same result.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2010-05-30T09:58:36+00:00

    I just attempted to use the "shutdown /l /f" command, but my icons still do not save their position on my desktop.

    Was this answer helpful?

    0 comments No comments