setirich Posted February 27, 2006 Share Posted February 27, 2006 Hi all, I have an issue that seems to focus on W2KP machines. I've not noticed it with XP or the occasional and rapidly disappearing WinMe. All of my machines are at the latest MS SP & security upgrades. The two commands I'm using are: Shutdown(2) Shutdown(9) The command after these execute is Exit. In 2K machines the shutdown hangs with a failure to elicit a response from Explorer.exe Any attempt to force a shutdown from the error dialog box (shutdown now) simply returns to the same condition after some amount of processor & disk activity. I suppose I could use a force command, but that's pretty rude for a long term solution. I was hoping, after almost 2 months of off & on research by myself, I could find a suggestion or a firm answer here. Thanks for any help you can offer, Rich Good intentions will always be pleaded for every assumption of authority. It is hardly too strong to say that the Constitution was made to guard the people against the dangers of good intentions. There are men in all ages who mean to govern well, but they mean to govern. They promise to be good masters, but they mean to be masters.-Daniel Webster Link to comment Share on other sites More sharing options...
BigDod Posted February 27, 2006 Share Posted February 27, 2006 Why do you need the exit command when you are shutting down the computer. Perhaps the exit command is exiting the script before the shutdown command executes properly. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
setirich Posted February 27, 2006 Author Share Posted February 27, 2006 Why do you need the exit command when you are shutting down the computer. Perhaps the exit command is exiting the script before the shutdown command executes properly.Thanks, It was hanging before I put the Exit there, and I actually put in the exit command as an attempt to make sure the script and everything else was closed. Without the command, it's still hangs. It's one of those nastly hangs that requires one to go physically to the box and hold the button for the required number of seconds (4?) to force the machine off. Good intentions will always be pleaded for every assumption of authority. It is hardly too strong to say that the Constitution was made to guard the people against the dangers of good intentions. There are men in all ages who mean to govern well, but they mean to govern. They promise to be good masters, but they mean to be masters.-Daniel Webster Link to comment Share on other sites More sharing options...
BigDod Posted February 27, 2006 Share Posted February 27, 2006 Have you checked that your computer is free from adware/spyware. Another thing that can cause problems with shutdowns is sound card drivers. It may be worth checking that you have the latest drivers installed and no shutdown sound set. Other than that I cant think of anything else. Sorry Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
CyberSlug Posted February 27, 2006 Share Posted February 27, 2006 (edited) I'd check the Windows event log to see if it gives more details. You might try terminating explorer before you shutdown: ProcessClose("explorer.exe") ProcessWaitClose("explorer.exe") Shutdown(2) Edited February 27, 2006 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
setirich Posted February 27, 2006 Author Share Posted February 27, 2006 Thanks Guys for the suggestions. I did find that there were newer vid drivers, not too much matter since I'm running headless with vnc most of the time...but I updated all. Checked for all sorts of bad stuff, including rootkits...found nothing fun to remove at all...FYI...these issues occur whether running headless or via kvm, so I don't think vnc is the bad boy here. It's just easier most times running from my main workstation to use the vnc thing. Oops...missed sound card drivers...again...hadn't been concerned since these boxes don't get used for sound at all, but what the heck...I'll check that too. For now though, until I get far ahead of the fray like I was when today started, It's gonna be codes 13 & 6 for sht & rbt. thanks again for the help... Rich Good intentions will always be pleaded for every assumption of authority. It is hardly too strong to say that the Constitution was made to guard the people against the dangers of good intentions. There are men in all ages who mean to govern well, but they mean to govern. They promise to be good masters, but they mean to be masters.-Daniel Webster Link to comment Share on other sites More sharing options...
setirich Posted February 27, 2006 Author Share Posted February 27, 2006 I did go a bit further than just looking at these suggestions. Looking into the Windows SDK, I found a very interesting command optional parameter for the ExitWindowsEx shutdown function:EWX_FORCEIFHUNG Which says to me..."Hey, we know sometimes stuff just happens. Get over it and make the thing do what you wanted it to do."So I guess we're not going to solve it here...I'll use this however when I re-write all my stuff in VB with some C calls...but that will be a few time periods away...You can find the MS ref herehttp://windowssdk.msdn.microsoft.com/libra...itwindowsex.aspIf you find it interesting, be sure to look at the example code link near the bottom of the page...I think that's as close as I'll get to having it "right".Rich Good intentions will always be pleaded for every assumption of authority. It is hardly too strong to say that the Constitution was made to guard the people against the dangers of good intentions. There are men in all ages who mean to govern well, but they mean to govern. They promise to be good masters, but they mean to be masters.-Daniel Webster Link to comment Share on other sites More sharing options...
steve8tch Posted February 27, 2006 Share Posted February 27, 2006 I don't know if it is related - but after patching a couple a weeks ago ALL of my PCs refused to restart on reboot.They would shut down OK - but not restart. When I say all - I only tried it on 5 - I couldn't risk it on the rest - all these PCs run attached to machines and have no keyboard, mice ,screen - I rely on remote reboots. After the reboot associated with this patch - they will reboot after that OK - all very odd - the thought of having to manually go round and physically reboot these PCs Link to comment Share on other sites More sharing options...
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