WMI Shutdown problem after SP2 upgrade

M

Mark

I have a script that depending on the day of the week will shutdown,
logoff, reboot or lock the computer when the user clicks on it. Since
upgrading machines to XP SP2 on the nights where the machine shuts down the
machines take forever (one we let go 1.5 hours before we powered the
machine off). The following is what is run to shut down the machine


Set OpSysSet =
GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}//./root/cimv2").ExecQuery("SELECT
* FROM Win32_OperatingSystem WHERE Primary = true")

Sub ShutDownWindows(dayofweek)
answer = MsgBox("Shut Down Windows?" & vbCrLf & "Warning: Save data
first!" & vbCrLf & "Click NO to cancel shutdown and save data.", vbQuestion
+ vbYesNo, dayofweek & " - Shut Down")
Select Case answer
Case vbYes
For Each OpSys In OpSysSet
outParam = OpSys.Win32Shutdown(8) 'Power Off
If err.number <> 0 Then
WScript.echo "Error number: " & Err.Number & vbNewLine &
"Description: " & Err.Description
End If
Next
Case vbNo
Msgbox "Shut down cancelled."
End Select
WScript.Quit
End Sub

Anyone have any ideas what might have changed with the upgrade to SP2?
Machines that are still on Windows XP SP1 or Windows 2000 work just as they
should.

Thanks for any help.
Mark
 
T

Torgeir Bakken \(MVP\)

Mark said:
I have a script that depending on the day of the week will shutdown,
logoff, reboot or lock the computer when the user clicks on it. Since
upgrading machines to XP SP2 on the nights where the machine shuts down the
machines take forever (one we let go 1.5 hours before we powered the
machine off). The following is what is run to shut down the machine
(snip)

Does it work better if you change to a forced poweroff:

OpSys.Win32Shutdown(8+4)
 
M

Mark

Doesn't seem to make a difference, I tried that when we first ran into this
problem. It still hangs on the Windows is shutting down screen. This also
happens on fresh installs of XP SP2.

Mark
 
T

Torgeir Bakken \(MVP\)

Mark said:
Doesn't seem to make a difference, I tried that when we first ran into this
problem. It still hangs on the Windows is shutting down screen. This also
happens on fresh installs of XP SP2.
Hi

I have seen many other posts (in the WinXP groups) about hanging
shutdowns also when using the GUI menu to initialize the shutdown,
so I think SP2 have a general problem here.

Do you see anything in the event logs?

You might want to open a support incident with Microsoft on this
issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top