Now this fall under the category, easy solutions to complex problems…

I recently had to remove about 150 computer objects from a MOM 2005 console, it was not possible to select all and choose remove so you had to right click each and every one of them – click “remove” and then answer “Yes” to the “Are you sure….” dialog…  Now imagine how long this would take to do manually!?  Well you could probably do some scripting that would solve the problem – however that would require some research to find, test and then implement..  but then it struck me, a flashback from back in Windows 3.1 where you had a macro recorder, this macro recorder would allow you to record keyboard and mouse actions and then play it back as many times as you would like (I remember making a macro sending emails and thus spamming some of my fellow students, great fun at the time), now someone must have made a freeware tool that will do this under modern versions of Windows, and sure enough – “Do it again” to the rescue…  “Do it Again” will allow you to make macros and play them back as many times as you’d like, it’s free and easy to use..

1. Get the util from here;

2. Install it

3. Start “Do it again” and click “create new task” and perform the task you want repeated.

4. Press “Scroll lock” (the button) once you are done with your task.

5. Name the macro in “Do it again” (a dialog box will pop up).

6. Under options set the number of times you want the task to repeat

7. Double click the macro you just created

8. Sit back in amazement and watch someone else making all the hard work for you, now it will still take time but you can sit back and drink coffee while it does.. NICE..  a simple solution to a time consuming problem…

Sadly I found out this does NOT work on Vista/Win7 🙁 – bummer, however I guess there will be some other util out there that will…

I just found a util  “Windows Macro Recorder” that claims to work on all windows versions, same concept as the above;

Just a quick link if you ever need to implement Microsoft Live Communications Server, here is a script that can assist you in modifying your AD users.

Do you have a temporary directory on your pc/server, you know one of those places where you put stuff to look at later but always forget to delete again?  It is likely that your answer is yes, but the more important question ought to be how do I automate cleanup of this directory?

There are numerous ways to do this, but I’ll just give you one here – google the rest if you are not satisfied..

It’s actually not as hard as it sound, you need to download a utility called “forfiles.exe” (put  it in c:\windows\system32 or similar) and then create a script much like this (here I presume the directory to cleanup is C:\tempdata);

rem Delete files on the server older than 14 days.
forfiles -p c:\tempdata-s -d -14 -c "cmd /c del /Q /F ""@FILE"""
rem Delete files older than 90 days
forfiles -p c:\tempdata-s -d -90 -c "cmd /c del /Q /F ""@FILE"""

And that is about it 🙂

So you need to fiddle a bit with Windows Update, the reasons can be many;

  1. you want to centrally initiate an update
  2. you are paranoid and want to script a daily/weekly or monthly Windows Update (in case the automatic detection fail).

Well, for help on how to launch it on different remote machines I suggest you visit Dave’s Blog;

A Desktop shortcut;
You could also simply create a desktop shortcut linking to

wuauclt.exe /resetauthorization /detectnow

This would force a Windows Updates detection to run upon clicking the shortcut, somewhat easier than launching the website.

The script you would need locally could look something like this;

@Echo off
Echo Stopping Windows Update Service
net stop wuauserv
Echo Starting Windows Update Service
net start wuauserv
Echo Forcing Windows Update detection
%windir%system32wuauclt.exe /detectnow

I also stumbled across some neat commands to try in case you are debugging Windows Update (update not working);

net stop wuauserv 
del /f /s /q %windir%SoftwareDistribution*.*
net start wuauserv 
wuauclt.exe /detectnow

net stop bits 
net stop wuauserv 
egsvr32.exe /s %windir%system32atl.dll 
egsvr32.exe /s %windir%system32jscript.dll 
egsvr32.exe /s %windir%system32msxml3.dll 
egsvr32.exe /s %windir%system32softpub.dll 
egsvr32.exe /s %windir%system32wuapi.dll 
egsvr32.exe /s %windir%system32wuaueng.dll 
egsvr32.exe /s %windir%system32wuaueng1.dll 
egsvr32.exe /s %windir%system32wucltui.dll 
egsvr32.exe /s %windir%system32wups.dll 
egsvr32.exe /s %windir%system32wuweb.dll 
net start bits 
net start wuauserv 
wuauclt /resetauthorization /detectnow

net stop bits 
net stop wuauserv 
regsvr32 /u wuaueng.dll /s
del /f /s /q %windir%SoftwareDistribution*.*
del /f /s /q %windir%windowsupdate.log
regsvr32 wuaueng.dll /s
net start bits
net start wuauserv
wuauclt.exe /resetauthorization /detectnow

PPS. Vista/Win2008 users beware.
Stopping services etc under windows vista/2008/7  require the scripts to be run as an administrator.

Forfiles -p c:ackup -s -m *.* -d -5 -c “cmd /c del /q @path”

This will delete all files in my backup directory older than 5 days. To test it first, use this:

Forfiles -p c:ackup -s -m *.* -d -5 -c “Cmd /C Echo 0x22@Path@File0x22”

Workarounds for XP users might be;—delete-files-older-than-xx-days.html (but this require additional software to be ‘installed’).

Hmm the below seem to be some unix variant, but maybe something similar is possible in Windows.–delete-files-older-than-x-days-239124.php (seem cool)
find /path/to/files* -mtime +5 -exec rm {} ; (the deluxe edition)

sms2 Bit of an oldie here, and still untested with newer GSM Phones, however should you want to have SMS capability in your organization this may be a cheap way to go.

It requires a compatible phone (and cable) and then you can fire off scripts (or commandlines) to send sms messages.  Seem easy enough, but sadly I don’t have a data cable to the old Nokia phone in our storage room 🙁

Do let me know if you try it and it works 🙂


I finnally had the chance to test this (I had no data cable for my cell phone), anyway it is all very straight forward until you try to send an sms from command line, this will fail with a message like this “there is no device previously used by SMS sender…….”.

Unfortunately the SMS sender software has a bug that causes it NOT to write your choice from the GUI to registry :-(,  so you need to enter the device name manually to registry.








The keyname is;
The key is a sting;
And the value is the name of your device/cell phone (as displayed in the GUI)
eg. “Nokia 6230i USB Modem” (without quotes)

once this is done you can send command line sms’s (as shown below P=phone number M=message L=Log message);

C:\Program Files\Microsoft SMS Sender>smssender.exe /p:12345678 /m:"Hello World" /l

















There are more details plus some C++ code for semi implementation into your own software here (it’s a rather basic launch routine for the exe file);

One problem with the SMS sender software if you use it in scripting, it will once the SMS is send bring up a message window telling you that the sms was send succesfully, now this is not that practical it this actually ‘halts’ thr process until the message window is closed (the above C++ code will as I can see solve this by killing the window afterwards).  Another issue, ONLY ONE sms can be send at the time, if you try to send several SMS’s in a row the software will fail – guess that is logical enough but not that practical if the script that sends the sms can somehow be called several times at nearly the same time..

Aparantly there also exists an Outlook 2003/2007 extention (MOSA) that will do something similar vai Outlook, I have not had time to test this but as it’s also from Microsoft it should work just as well or maybe even better(however this requires Outlook);

So you for some reason or other need a custom GroupPolicy template (.adm template) to set some strange setting for some odd software.

You can use a Policy.ADM file to set custom registry values either for your own pc (may seem like a bit overkill) or more likely for your domain.

Well I have created a few of these back in the good old NT4 days and it was not all that difficult once you got the hang of it, and thus when I had the need again lately I was confident I could get it to work without too much of a hassle.

I was wrong :-/

Ok, creating a simple policy.adm file is easy;


And if you enter a keyname like;

Things will work brilliantly, however lets say you want to change some obscure value for the adobe reader!?  This is outside the “Policies” section of the registry.. things will look like this when you enter the GPM MMC console.


This is where I lost my temper and started cursing at my monitor, see again once I put “Policies” in the keyname everything worked like a charm (but my setting was NOT in the Policy region of the registry)..

So Google to the rescue, it would seem that things have changed since the good old Poledit days, and that you need to do a bit of editor tweaking to get those ‘dirty’ settings available under NT4+ systems now-er-days.

Here is the secret;

View, Filtering, “Only show policy settings that can be fully managed”..

Once this is done you can see everything – just like in the good old days 😀


Also it’s worth noting the other filter settings, I did not even know they existed, now you can actually limit your view to only those settings that are set, and this DO make it a lot easier to overlook the more complex policies.

Good luck making your new policies its easy as pie you know..