Windows


The other day, there was a post on one of the mailing lists that I follow about accessing the Windows Event Logs. I thought that was an interesting topic, so I went looking for examples and found a pretty nice example on ActiveState. In this article, you’ll find out what I discovered. (more…)

Most typical users have used Microsoft Office. While Office may be the bane of tech support, we still have to deal with it. Python can be used to script (AKA automate) Office and make it easier for us or our users to use. It may not be as easy as recording a macro, but it’s close. For this article, you will learn how to use the PyWin32 module to access some of the Office programs and manipulate them with Python. Some forums say that you need to run PythonWin’s makepy utility on Microsoft Word (and Excel) before you can access Office applications. I don’t think I needed to do that to make it work though (at least, not with the 2007 version). However, PythonWin comes with the PyWin32, so if you do run into trouble, you can try it. (more…)

The other day, I received a request to create a script that could tell how long a Windows XP machine had been idle and to alert the user if it had been idle for a certain amount of time. I did a little research with Google and found a couple of ways to accomplish this feat. The only one I was able to get working was a ctypes example, so without further ado, let’s check it out! (more…)

Soon after getting hired at my current job, my boss sent me a script (which I think was based on this article) about Python and a certain text-to-speech module called pyTTS. This was right after Python 2.5 had released. Anyway, it’s basically a nice wrapper over the win32com module which can communicate with the Microsoft Speech API (SAPI). (more…)

Have you ever wanted to restart your Windows PC with out pressing Start, Shutdown or CTRL+ALT+DEL? What about restarting your annoying co-worker’s PC…the one who just doesn’t know when to shut up? Well, Python has the answer and this blog will tell you how to do it! (more…)

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”. (more…)

This week I was tasked with trying to find a way to find out what the Peak Commit value was on our virtual workstations. The reason being that we are trying to save money and were wondering if we were allocating too much memory or not. We didn’t need the Total Commit Charge or the Limit Commit Charge values, but since I figured out how to get those during my research, I’ll show how to get those as well. (more…)

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. (more…)

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. (more…)

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. (more…)

Next Page »