> To me the bigger criticism is that there are probably 600 other programs
> that do the same > thing, but what fun would it be for me to use someone
> else's program...
got it.
I'll take a look at your program.
___
python-win32 mailing list
python-
> Is this capability not already part of XP?
> I've got my machines set to go to sleep after 1 hour,
> no programming needed.
> Right click on the Desktop, Properties, ScreenSaver, Power.
A couple of problems with doing it like that:
1) if you set your computer to go to sleep after X minutes, you
Message: 3
Date: Fri, 05 Dec 2008 08:40:32 -0600
From: Mike Driscoll <[EMAIL PROTECTED]>
Subject: Re: [python-win32] rebooting windows from Python?
To: [EMAIL PROTECTED]
Cc: Python-Win32 List
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Alec,
I've been using the following method that I found on
ActiveState's Cookbook, which I modified a little
(http://code.activestate.com/recipes/360649/):
Does that method ever hang during shutdown? I've tested the WMI method a few
times and got one hang, where it was asking me to termi
> I've been using the following method that I found on
> ActiveState's Cookbook, which I modified a little
> (http://code.activestate.com/recipes/360649/):
Does that method ever hang during shutdown? I've tested the WMI method a few
times and got one hang, where it was asking me to terminate a pr
Alec,
And thus I say for the second time in 24 hours: Eureka!
For anyone else coming down this path, here's how to shutdown, reboot or logoff Windows, each with the option to force the action. In other words, you can force Windows to reboot even if its asking if you want to save a document.
And thus I say for the second time in 24 hours: Eureka!
For anyone else coming down this path, here's how to shutdown, reboot or logoff
Windows, each with the option to force the action. In other words, you can
force Windows to reboot even if its asking if you want to save a document.
nLogOf
Alec Bennett wrote:
import wmi
wmi.WMI(privileges=["Shutdown"]).Win32_OperatingSystem()[0].Shutdown ()
Stylin, works. The only thing it doesn't do that I personally need
it to do is the "force shutdown". In other words "shutdown.exe -f".
I found this page with some hints but couldn't get
>
> import wmi
>
> wmi.WMI(privileges=["Shutdown"]).Win32_OperatingSystem()[0].Shutdown ()
>
>
Stylin, works. The only thing it doesn't do that I personally need it to do is
the "force shutdown". In other words "shutdown.exe -f". I found this page with
some hints but couldn't get it to work:
Tim Roberts wrote:
Alec Bennett wrote:
I'm wondering if there's some way to reboot or shutdown Windows from within Python?
I can log out like this:
win32api.ExitWindowsEx(4)
And according to the documentation, I should be able to shutdown like this:
win32api.ExitWindowsEx(2)
But that retur
To restart I use:
outFileObject = os.popen("shutdown -r -t 05", 'r')
To shutdown swap -r for -s. This is the same as running the "shutdown -r -t
05" on the command prompt.
The number is the delay and the outFileObject catches any messages that
would be printed out to the command prompt window.
Alec Bennett wrote:
> I'm wondering if there's some way to reboot or shutdown Windows from within
> Python?
>
> I can log out like this:
>
> win32api.ExitWindowsEx(4)
>
> And according to the documentation, I should be able to shutdown like this:
>
> win32api.ExitWindowsEx(2)
>
> But that returns
I'm wondering if there's some way to reboot or shutdown Windows from within
Python?
I can log out like this:
win32api.ExitWindowsEx(4)
And according to the documentation, I should be able to shutdown like this:
win32api.ExitWindowsEx(2)
But that returns the following error:
'A required priv
13 matches
Mail list logo