Anyone use Win32Shutdown on a ME pc?

C

cj

If TimeValue(Now) > TimeValue(ShutdownTime) Then
Dim WMIService, Computer As Object
WMIService =
GetObject("Winmgmts:{impersonationLevel=impersonate,(Debug,Shutdown)}")
For Each Computer In WMIService.InstancesOf("Win32_OperatingSystem")
Computer.Win32Shutdown(8 + 4, 0) 'shutdown
Next
End If

My problem is it doesn't work on ME. Well, it prompts me for a
password. I don't use passwords on my old ME pc. Any help would be
appreciated. It's an old pc but it still serves it function and it
would be nice to modify one of my programs on it to shut it down
automatically.
 
W

Walter Wang [MSFT]

Hi cj,

Sorry this is not a direct answer to your question.

Please note Windows ME support is retired:

http://support.microsoft.com/lifecycle/?LN=en-us&p1=6519&x=12&y=5


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

cj

Yea, I know, but I had hoped someone here would know the answer--maybe
someone still will answer. It's a personal project.
 
C

cj

First let me note that while I denote 8 + 4 in my code as shutdown it's
actually power off + forced. Power off is what I personally mean when I
refer to shutting down a machine and what I desire. But I want to get
that straight before I get into the solution as they aren't the same
thing to Win32Shutdown.

In working with Windows ME my frustration is that 8 + 4 acted like log
off which was all the more interesting because I don't have users set up
on my ME machine. So I started testing all the options of
Win32Shutdown. First I confirmed 0 + 4 which is log off does the same
thing I 8 + 4 is doing. I then tried 2 + 4 or forced reboot and it
worked. Although I could see little use of 1 + 4 or forced shutdown w/o
the power off I tried it as well and found that for some reason it turns
the power off after shutdown. Hey that's what I was looking for. So
for what it's worth it would seem that to power off a ME machine you use
shutdown vs power off parameters in Win32Shutdown.
 

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