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 ...
25th April 2008, 12:49 PM #1
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"
25th April 2008, 02:18 PM #2
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.
26th April 2008, 10:50 AM #3
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.
27th April 2008, 12:51 AM #4
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
6th November 2008, 02:04 PM #5
- Rep Power
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!
6th November 2008, 02:37 PM #6
Originally Posted by quaium
Possibly, but instead you could use Shutdownertron and never have to worry about it again.
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?
6th November 2008, 02:55 PM #7
Originally Posted by quaium
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
6th November 2008, 02:59 PM #8
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.
By tech_guy in forum Windows
Last Post: 18th February 2010, 12:29 AM
By gshaw in forum Windows
Last Post: 23rd April 2008, 09:11 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)