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
Mike Driscoll wrote:
We're doing what amounts to a registry session audit here at work, so I
need to walk a specific set of subfolders in our registry and get the
contents thereof. The subfolders will vary from user to user. I found
Tim Golden's excellent registry walking script on his website
code
import wmi
wmi.WMI(privileges=[Shutdown]).Win32_OperatingSystem()[0].Shutdown ()
/code
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:
Alec Bennett wrote:
code
import wmi
wmi.WMI(privileges=[Shutdown]).Win32_OperatingSystem()[0].Shutdown ()
/code
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
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.
code
Tim Roberts wrote:
Mike Driscoll wrote:
We're doing what amounts to a registry session audit here at work, so
I need to walk a specific set of subfolders in our registry and get
the contents thereof. The subfolders will vary from user to user. I
found Tim Golden's excellent registry walking
Dahlstrom, Roger wrote:
If you can read the registry, you can save it without any other
special permissions. It is just text.
Just export a branch of your own registry and open it with notepad
to see the format. I do it all the time, it works fine.
You're quite right, Roger, and other
Tim Golden wrote:
div class=moz-text-flowed style=font-family:
-moz-fixedDahlstrom, Roger wrote:
If you can read the registry, you can save it without any other
special permissions. It is just text.
Just export a branch of your own registry and open it with notepad to
see the format. I do
Well, sure the registry itself is not text, but the keynames contained within
it are, and so are the values, once you've read them. Basically what I'm
saying is not that you need *no* permissions, just that you don't need any
*special* permissions - if you have permission to read it and
Dahlstrom, Roger wrote:
... Basically what I'm saying is not that you need *no* permissions, just
that you don't need any *special* permissions - if you have permission to
read it and enumerate the subkeys, that is (at least in my experience, maybe
I'm not doing exactly what the request
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
Well, like I said, I've never done it in Python, and this is going back a bit,
so some things might be different, but I'm not talking about RegSaveKey or
RegRestoreKey, I'm talking about using EnumKey and CreateKey. As far as I can
remember, I didn't have any special permissions for that.
Dahlstrom, Roger wrote:
Well, like I said, I've never done it in Python, and this is going back a
bit, so some things might be different, but I'm not talking about RegSaveKey
or RegRestoreKey, I'm talking about using EnumKey and CreateKey. As far as I
can remember, I didn't have any
I think my mistake was assuming that reading the values was going to be
sufficient. For all the purposes I've used, it was. For my edification,
what's the functional difference? I mean, what I was doing was able to walk
the registry, extract information, save it for later, modify it, then
Let's say I've got a window for which I want to simulate a mouse click
at a specific x, y coordinate. I already have the hwnd but I'm not sure
how to construct the lParam. I've used SendMessage in the past to click
on buttons, etc., but I knew their hwnds. How do I construct the lParam.
Per the
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'll
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
Rickey, Kyle W wrote:
Let’s say I’ve got a window for which I want to simulate a mouse click
at a specific x, y coordinate. I already have the hwnd but I’m not
sure how to construct the lParam. I’ve used SendMessage in the past to
click on buttons, etc., but I knew their hwnds. How do I
Dahlstrom, Roger wrote:
I think my mistake was assuming that reading the values was going to be
sufficient. For all the purposes I've used, it was. For my edification,
what's the functional difference? I mean, what I was doing was able to walk
the registry, extract information, save it
Thanks Tim. I used the following to select my tab of interest:
TCM_SETCURSEL = 0x130C
win32gui.SendMessage(hwnd, TCM_SETCURSEL, 3, 0)
However, according to MSDN:
http://msdn.microsoft.com/en-us/library/bb760612(VS.85).aspx
Remarks
A tab control does not send a TCN_SELCHANGING or
Apparently I jumped the gun.
I tried:
lParam = (y 16) | x
win32gui.SendMessage(top_hwnd, win32con.WM_LBUTTONDOWN, 0, lParam)
win32gui.SendMessage(top_hwnd, win32con.WM_LBUTTONUP, 0, lParam)
with x and y 1st being on-screen coordinates, and 2nd with x and y being
referenced from the corner of
Rickey, Kyle W wrote:
Thanks Tim. I used the following to select my tab of interest:
TCM_SETCURSEL = 0x130C
win32gui.SendMessage(hwnd, TCM_SETCURSEL, 3, 0)
However, according to MSDN:
http://msdn.microsoft.com/en-us/library/bb760612(VS.85).aspx
Remarks
A tab control does not send a
OK - so if I'm correct in understanding this, let's say hypothetically, I have
something like so...
HKLM...
something
something else
something else
something else
If I were to use my operation, and export the entire tree, I would get a
23 matches
Mail list logo