+ Post New Thread
Results 1 to 8 of 8
Scripts Thread, Psshutdown problem in Coding and Web Development; Hi guys - can anyone see what I'm doing wrong? I've got a shutdown script that runs from a Scheduled ...
  1. #1

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,224
    Thank Post
    54
    Thanked 276 Times in 184 Posts
    Rep Power
    133

    Psshutdown problem

    Hi guys - can anyone see what I'm doing wrong? I've got a shutdown script that runs from a Scheduled Task, I've created an Admin type account to run the script. If I run it from the command prompt - everything is OK. If I run it as a scheduled task - it seems to hang - I can see psshutdown in the task manager - and if I kill it - the batch file finishes OK. Theere are entries in the log file up to where psshutdown is called, then nothing until I kill the process, and the completed entry is added to the log???

    Heres the file :

    echo "Starting PC Shutdown script" > "C:\Winapps\Logoffs\shutdown.log"

    echo "Starting LimitLogon clearout" >> "C:\Winapps\Logoffs\shutdown.log"

    "C:\Program Files\LimitLogin\llogincmd.exe" /c

    echo "Starting PC Shutdown" >> "C:\Winapps\Logoffs\shutdown.log"

    "C:\winapps\logoffs\PSShutdown.exe" @PCList.txt -m "Shutting down in 20 seconds - Press cancel to stay online" -f -c -n 10 >> "C:\Winapps\Logoffs\shutdown.log"

    echo "Completed" >> "C:\Winapps\Logoffs\shutdown.log"

  2. #2
    altecsole's Avatar
    Join Date
    Jun 2005
    Location
    Morecambe, Lancashire, UK.
    Posts
    281
    Thank Post
    39
    Thanked 36 Times in 26 Posts
    Rep Power
    25
    The first time you run PSShutdown you have to accept the license and then a value is stored in the user part of the registry. If the user you are running this task as doesn't have this setting in their profile the program will just hang waiting for the license to be accepted.

    Just logon with the account you want to run the scheduled task as and run PSShutdown, accept the license, and then logoff. You shouldn't then have any problems.

  3. #3

    Join Date
    Jan 2006
    Location
    Surburbia
    Posts
    2,178
    Thank Post
    74
    Thanked 307 Times in 243 Posts
    Rep Power
    115
    The curse of the MS sysinternal assimilation - the eula thing sounds feasible and I think the best way is to put the "/accepteula" option on the command line.

  4. #4

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,224
    Thank Post
    54
    Thanked 276 Times in 184 Posts
    Rep Power
    133
    Thanks guys - think I might have found the prob - an extra blank line at the end of the list of PCs - it looks like psshutdown just stopped there waiting and never continued - and during testing I used a truncated list without the problem *blush*. I'll check that it all runs OK on Monday night. Cheers

  5. #5

    Join Date
    Jan 2008
    Location
    London
    Posts
    43
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    PSShutdown Help!

    Hi guys,

    I was wondering if anyone could help me with trying to sort out my PSShutdown command. I have a .cmd file that contains the following:

    D:\shutdown\psshutdown @D:\Shutdown\Computers.txt -f -c -t 120 -n 10 -v 120 -m "Your PC will shutdown in 2 minutes. Please save all work and log off. If you wish to continue working click cancel but please remember to shutdown manually once you have finished."

    However, the command seems to hang every time it finds a PC that is turned off. Is there something that I can add to the above so that it first checks to see if a PC is on? And then if a PC is off it skips that PC and moves on to the next one on the list?

    Thanks in advance!

  6. #6

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Quote Originally Posted by quaium View Post
    However, the command seems to hang every time it finds a PC that is turned off.
    It will.

    Is there something that I can add to the above so that it first checks to see if a PC is on? And then if a PC is off it skips that PC and moves on to the next one on the list?
    Possibly, but instead you could use Shutdownertron and never have to worry about it again.

  7. #7

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,236
    Thank Post
    1,057
    Thanked 1,067 Times in 624 Posts
    Rep Power
    740
    Quote Originally Posted by quaium View Post
    Hi guys,

    I was wondering if anyone could help me with trying to sort out my PSShutdown command. I have a .cmd file that contains the following:

    D:\shutdown\psshutdown @D:\Shutdown\Computers.txt -f -c -t 120 -n 10 -v 120 -m "Your PC will shutdown in 2 minutes. Please save all work and log off. If you wish to continue working click cancel but please remember to shutdown manually once you have finished."

    However, the command seems to hang every time it finds a PC that is turned off. Is there something that I can add to the above so that it first checks to see if a PC is on? And then if a PC is off it skips that PC and moves on to the next one on the list?

    Thanks in advance!

    You shutting the PCs down with the correct username and password ?

    Also checkout: Shutdown Computers in 4 Classrooms Script / Prog which I did a while ago or powdarrmonkey's EduGeek Shutdownertron

  8. #8

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,224
    Thank Post
    54
    Thanked 276 Times in 184 Posts
    Rep Power
    133
    Not withstanding the very lovely Shutdownertron - this is our call

    C:\winapps\logoffs\PSShutdown.exe -c -k @PCList.txt -f -t 30 >> C:\Winapps\Logoffs\shutdown.log

    I couldn't get it to work with a message in the line - and gave up.

SHARE:
+ Post New Thread

Similar Threads

  1. PsShutdown help needed!
    By tech_guy in forum Windows
    Replies: 13
    Last Post: 17th February 2010, 11:29 PM
  2. Logging psshutdown?
    By gshaw in forum Windows
    Replies: 3
    Last Post: 23rd April 2008, 08:11 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •