Tag: VBScript

Quirks of VBScript

A couple of things I’ve learnt recently: Variables of a single character don’t get picked up with Option Explicit. This is definitely worth knowing! Running either or Will generally work, however they don’t seem to work consistently. or Will work

Posted in Guides Tagged with:

Script to move a machine in AD after adding it to the domain

This is probably the script of which I’m most proud. Although I haven’t used it at many employers, it took a lot of testing to get it working. This script checks the Computers container in Active Directory for machines that

Posted in Guides Tagged with: ,

Script to defrag C: drive

Windows operating systems prior to Vist and Server 2008 didn’t have the functionality of easily scheduling a defrag job from the GUI. Using the script below you can create a scheduled task to regularly defragment your disks. I recommend using

Posted in Guides Tagged with: ,

Script to clear temporary files

This is a script I put together a few years ago, but have ended up using at some point at every employer since. Installing an application (or even just running one) can create lots of temporary files. It’s not unusual

Posted in Guides Tagged with: , ,