Tag Archives: Windows

Python’s _winreg: Editing the Windows Registry

Python’s standard library is known for including lots of handy modules and packages that can be used without installing anything else. That’s one of the primary reasons that its standard library is called “batteries included” so often. So it should come as no surprise that Python includes a Windows only module for editing the Windows Registry. This particular module goes by the odd name of _winreg (odd because it starts with an underscore). In this article, we’ll learn the basics of working with the Registry using this “battery”. Continue reading Python’s _winreg: Editing the Windows Registry

Finding Installed Software using Python

Have you ever wondered what software was installed on your PC? Most people who use Windows would probably go to Add/Remove Programs to find out this information, but they’re not programmers. No, programmers have to script it because it’s just in our blood to do so. I actually had another reason to do so: my boss wanted me to log what was installed on our user’s PCs so we’d know if our users were installing unauthorized software. Thus, there’s also a practical reason to attempt this. Continue reading Finding Installed Software using Python

Creating Windows Shortcuts with Python (Part II)

Back when I first wrote about creating shortcuts with Python last month, I kept thinking to myself that I had a 3rd way of doing it. Today, I had to maintain some of my shortcut code and I stumbled upon it once more. I also noticed that my post had received a comment from Tim Golden on yet another way to create shortcuts, so I’ll include that in this post as well. Continue reading Creating Windows Shortcuts with Python (Part II)

Python, Windows and Printers

I do a fair amount of technical support in addition to my software development. In our small shop, we get to troubleshoot anything that is related to technology, from networks to software to printers. I think one of the most annoying aspects is trying to get printers to work the way the user wants. Another issue is setting up printers for users that have to roam from PC to PC as a part of their job. These users usually only need the printers that are in their specific location at any given time. It’s very difficult to accommodate this type of user, especially if the PCs are being used 24/7, which is true in my case. This is where Python comes in. Continue reading Python, Windows and Printers

Using Python to Edit Bad Shortcuts

A couple weeks ago, I wrote about some scripts we use at work for creating shortcuts to various programs in Windows. Well, we also push out updates to some programs which change the paths of the programs and then we need to change the user’s shortcuts to match. Unfortunately, some user’s will change the name of the shortcut which can make finding it difficult. Python makes it easy to find the shortcut I need to change though and in this article I’ll show you how to do it. Continue reading Using Python to Edit Bad Shortcuts

Using Python to Reduce the Roaming Profile

Roaming Profiles are a blessing and a curse. If the user uses the internet, their browser’s cached files will grow like mad. If the user downloads programs to their desktop or creates large Powerpoint files anywhere in their profile, then they have to be managed whenever the user logs in or out. There are several solutions to this problem: disk quotas, blocking the ability to download or put stuff in one’s profile, etc. In this article, I will show you how to exclude specific directories from the user’s profile using Python. Continue reading Using Python to Reduce the Roaming Profile

Enabling Screen Locking with Python

A few months ago, my employer needed to lock down some of our workstations to be compliant with some new software we were installing from another government organization. We needed to force those machines to lock after so many minutes elapsed and we needed to make it such that the user could not change those settings. In this article, you’ll find out how do this and as a bonus, I’ll also show you how to lock your Windows machine on demand with Python. Continue reading Enabling Screen Locking with Python

Lock Down Windows with Python

Almost four years ago, I was tasked with converting a Kixtart script to Python. This particular script was used to lock down Windows XP machines so they could be used as kiosks. Obviously, you don’t need Python to do this. Any programming language that can access the Windows Registry will be able to do this or you could just use Group Policies. But this is a Python blog, so that’s what you’re going to get in this article! Continue reading Lock Down Windows with Python

More Windows System Information with Python

Last month I wrote a post about getting Windows system information and I mentioned in one of my comments that there was another script that did some of this as well as other stuff, but I couldn’t find it. Well, today I went digging for it and found the script I wanted. So we’re going back down the rabbit hole for some more tips and tricks for getting information about the wonderful world of Windows using Python. Continue reading More Windows System Information with Python

Getting Windows System Information with Python

Another script I had to come up with for my employer dealt with getting various bits and pieces of information about each of our user’s physical machines. We wanted to keep track of the CPU speed, hard drive sizes and the amount of RAM they had (among other things) so we would know when it was time to upgrade their computer. Gathering all the pieces from the various places on the internet was a royal pain, so to save you the trouble, I’m going to post what I found. Note that a lot of this code was taken from various recipes on ActiveState or mailing lists. Most of the following can be found almost verbatim in this recipe. Continue reading Getting Windows System Information with Python