Yesterday, I needed to create a script that would allow me to stop a lot of services in one go, so I created a small one-liner script. However, as it could be dangerously easy to execute this by mistake, I decided to figure out how to apply WhatIf as a… Read more »
In PowerShell, there is the Get-Process cmdlet. However, this does not return the ParentProcessId property, so it is unsuitable for displaying an indented process tree, which you, for instance, could send by email. Luckily, there is the Get-WMIObject cmdlet that can return the ParentProcessId. How to get a Process Tree… Read more »
Reading the Windows registry from PowerShell can be a bit cumbersome, when all you wanted to retrieve is the value of an item under a key, at least with PowerShell version before v5. The Get-ItemProperty can be used to enumerate the items and their values under a registry key, but… Read more »
This post contains a few (short) useful PowerShell functions and snippets, that you can include in projects and/or your profile, and some which showcase some peculiar solutions to problems in PowerShell. This one is for use in your profile, so you can see in Alt-Tab which Powershell console is running… Read more »
In this article, I present an easy way to merge all video files in a directory using the Open Source tool mencoder (part of mplayer, the video player) using a batch file, suitable for Windows XP and later. The method below supports merging AVI, MPG, MP4, WMV and RM files.
Found this handy python script for sharing Clementine song status in Empathy….. regrettably it did not work on my Ubuntu 12.10 desktop installation…. Apparently you have to add a line (see the second line) about the character encoding nowadays….. so just to make it easier for other people… here’s the… Read more »
In this article I will give some extra information on the usage of CMD.EXE variables in batch files. These variables are stored in the so-called Environment, hence the name Environment Variables. There are two environments on a Windows machine: The System and the User environment. When a variable is set… Read more »
This week I needed to clear the ‘logon script’ field of all AD users (who had one set). While working on the code, I noticed you couldn’t just do ‘ objUser.scriptPath=”” ‘ as this would result in an error. So this was done with PutEx. The following will search for each… Read more »
This article addresses one specific use case for recursion in batch: Recursively looping through a directory (also called a folder) and its sub directories. Normally, this is a pain, and it took me a while to come up with an algorithm that works. For recursion to work correctly, you need:… Read more »
One of the annoying things in Windows XP/2003 and later, is that the construct if not exist c:\test\*.* echo No files! does not work as expected if c:\test is empty. This seems to be due to the fact that Windows regards the “.” and “..” file entries as valid files… Read more »