By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,277 Members | 1,433 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,277 IT Pros & Developers. It's quick & easy.

Remote Shutdown let the target PC hang

P: n/a
Hi there,

I've got a serious problem with getting a remote shutdown functionality
working with VB.NET. I am using WMI to query the target PC and invoke the
Win32Shutdown method like this:

Dim aoInParams() As Object = {8}

For Each mngObj As ManagementObject In mngColl
mngObj.Scope.Options.EnablePrivileges = True
mngObj.InvokeMethod("Win32Shutdown", aoInParams)

with mngColl being the ManagementObjectCollection, retrieved earlier.

However, I am experiencing the following behaviours:
- On a target computer with a logged in user, the computer shuts down
without any problems
- On a locked target computer or with nobody logged in, the computer shuts
down until it says "Windows is shutting down". Then, it simply hangs.

In both cases, the InvokeMethod tends to hang.

I also tried to call Win32Shutdown with "12", meaning a forced shutdown, so
that even locked computers can be powered off. But I got the same effects.

Is there any possibility, that the problem resides on the target computer,
i.e. some BIOS option, ACPI setting, driver problem, or something?

I am desperate. Does anyone have a failure proof example of how to powering
off a remote windows XP client with VB.NET?

Best regards and thank you for reading this,
Apr 11 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.