Monthly Archives: March 2012

Remove old folders on Windows using batch script

I have found nice batch script which will remove all folders inside specific folder. This is good when you have some directory with automatic builds and want to remove old scripts from time to time.

ForFiles /P "BASE_FOLDER_PATH" /D -14 /C "CMD /C if @ISDIR==TRUE echo RD /Q /S @FILE &RD /Q /S @FILE"

Replace BASE_FOLDER_PATH with folder containing automatic builds and 14 with maximum number of days. Older folder will be removed.

MSSQL’s ISNULL in MySQL

I am unable to remember this and have to find it each time I need it. In MSSQL there is a great function called ISNULL. It has two parameters. If the first one is NULL it takes the second one. In MySQL ISNULL takes only one parameter and checks whether it is NULL or not. The real replacement for MSSQL‘s ISNULL in MySQL is IFNULL.

Change UUID of harddisk image file using VirtualBox

You may get the following error when importing existing image to the VirtualBox:
A hard disk with UUID {e9758c99-e50c-41c7-877f-f03c1454d136} or with the same properties (‘image.vhd’) is already registered.
This happens when you make copy of a virtual image and want to add it to VirtualBox, but the original image is also registered. To change the UUID use the VBoxManage utility installed with VirtualBox.

VBoxManage.exe internalcommands sethduuid image.vhd