473,320 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Set up Windows environment with python

Jim

My company resells windows machines, and we install our software, and
do a bunch of customization to make sure that all the desktop settings
are optimal... we adjust the screen resolution, color depth, and
referesh rate, remove shadows from menus and the mouse pointer, set
the power management options, disable the screensaver, etc... (very
long list)

I've started doing most of what I want with ctypes:

def disableShadows():
# constants taken from WinUser.h in the PlatformSDK
SPI_SETCURSORSHADOW = 0x101B
rv =
ctypes.windll.user32.SystemParametersInfoA(SPI_SET CURSORSHADOW, 0,
False, win32con.SPIF_SENDWININICHANGE)

# remove shadows from menus
SPI_SETDROPSHADOW = 0x1025
rv = ctypes.windll.user32.SystemParametersInfoA(SPI_SET DROPSHADOW,
0, False, win32con.SPIF_SENDWININICHANGE)

But I'm finding that none of the changes seem to be permanent. I'm
wondering if I need to start changing the current Explorer theme
information instead, or go right to the registry and start changing
values.

Desktop wallpaper changes work, but they aren't permanent... rebooting
restores the previous desktop wallpaper.

Does anyone have any experience with this sort of system preperation
scripting?

Thanks,
-Jim

Sep 29 '05 #1
3 2237
I don't have experience with scipting this... but I know that
resolution for example is stored in registry, and _that_ is what is
loaded when you boot.

I think most, if not all, of your changes will be found in the registry
(for permenance).

Also, have you checked out PyWin32? It's just a big pre-made wrapper
for the Win32 stuff, not sure if it will be more/less work than ctypes
but it could make it easier on you.

PyWin32
http://sourceforge.net/project/showf...group_id=78018

Sep 29 '05 #2
"Jim" <mr*****@gmail.com> writes:
My company resells windows machines, and we install our software, and
do a bunch of customization to make sure that all the desktop settings
are optimal... we adjust the screen resolution, color depth, and
referesh rate, remove shadows from menus and the mouse pointer, set
the power management options, disable the screensaver, etc... (very
long list)

I've started doing most of what I want with ctypes:

def disableShadows():
# constants taken from WinUser.h in the PlatformSDK
SPI_SETCURSORSHADOW = 0x101B
rv =
ctypes.windll.user32.SystemParametersInfoA(SPI_SET CURSORSHADOW, 0,
False, win32con.SPIF_SENDWININICHANGE)

# remove shadows from menus
SPI_SETDROPSHADOW = 0x1025
rv = ctypes.windll.user32.SystemParametersInfoA(SPI_SET DROPSHADOW,
0, False, win32con.SPIF_SENDWININICHANGE)

But I'm finding that none of the changes seem to be permanent. I'm
wondering if I need to start changing the current Explorer theme
information instead, or go right to the registry and start changing
values.

Desktop wallpaper changes work, but they aren't permanent... rebooting
restores the previous desktop wallpaper.

Does anyone have any experience with this sort of system preperation
scripting?


From looking at the MSDN docs, it seems you have to add
SPIF_UPDATEINIFILE (Writes the new system-wide parameter setting to the
user profile) to the last argument.

Thomas
Sep 29 '05 #3
Jim
Thanks Thomas! That did it.

I can now set the wallpaper, mouse shadows, menu shadows, and I can
disable the screensaver.

Does anyone know how I can adjust the power options? I want to make
sure any hibernate or standby options are set to Never.

Thanks,
-Jim

Sep 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: sebastien.hugues | last post by:
Hi I would like to retrieve the application data directory path of the logged user on windows XP. To achieve this goal i use the environment variable APPDATA. The logged user has this name:...
6
by: Colin Brown | last post by:
Recently I was looking for remote management tools and came across "Windows Management Instrumentation". There is a python interface available: http://tgolden.sc.sabren.com/python/wmi.html I...
3
by: Ryan Smith | last post by:
Hello All, I am new to the list and python community as well. I was wondering if anyone knows of any good python books emphasizing Windows 2000? I am a network engineer in an Active Directory...
19
by: Eric | last post by:
I'm trying to have some scripts run periodically on Windows XP and found the "Task Scheduler" did not execute my scripts. My scripts are of the form scriptName.py, and will run just by invoking that...
4
by: Zach Shutters | last post by:
I am new to python and working my way through the van Rossum tutorial. I am cursios though about if you can program windows with python? I know I shouldn't worry about this right now but I am...
12
by: Mike Dee | last post by:
A very very basic UTF-8 question that's driving me nuts: If I have this in the beginning of my Python script in Linux: #!/usr/bin/env python # -*- coding: UTF-8 -*- should I - or should I...
17
by: Paul Rubin | last post by:
Dumb question from a Windows ignoramus: I find myself needing to write a Python app (call it myapp.py) that uses tkinter, which as it happens has to be used under (ugh) Windows. That's Windows...
0
by: peter | last post by:
Hello all, I would like to debug my python libraries, written in c++, with GDB (gnu debugger) I'm using the mingw compiler in a windows environment. As development environment I use eclipse...
6
by: Fuzzyman | last post by:
Hello all, I would like to set a Windows Environment variable for another (non-child) process. This means that the following *doesn't* work : :: os.environ = value In the ``win32api``...
3
by: Pradeep | last post by:
Hi friends, We are changing the python application from Unix to Windows. The source code of Python application should work well in windows. How to make changed to windows environment. In Python...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.