SpuffMonkey Posted April 25, 2008 Posted April 25, 2008 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"
altecsole Posted April 25, 2008 Posted April 25, 2008 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.
PiqueABoo Posted April 26, 2008 Posted April 26, 2008 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.
SpuffMonkey Posted April 26, 2008 Author Posted April 26, 2008 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
quaium Posted November 6, 2008 Posted November 6, 2008 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!
powdarrmonkey Posted November 6, 2008 Posted November 6, 2008 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.
mattx Posted November 6, 2008 Posted November 6, 2008 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: http://www.edugeek.net/forums/scripts/21448-shutdown-computers-4-classrooms-script-prog.html which I did a while ago or powdarrmonkey's EduGeek Shutdownertron
SpuffMonkey Posted November 6, 2008 Author Posted November 6, 2008 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now