DXL: Delete a directory
There is a function native to DXL that allows you to create a new directory. However, after looking through the documentation, I was unable to find a similar function to delete a directory. This functionality can be achieved by executing a system call. On a Windows XP machine, it looks like this:
DXL
string folder = "C:\\path\\to\\directory" //Create a directory mkdir(folder) //Remove a directory system("C:\\windows\\system32\\cmd.exe /c rmdir " folder " /s /q")
This will recursively delete all files contained in the directory and the directory itself. My best results came from calls to cmd.exe, not command.com as the documentation suggests.
As an aside, the system() call allows your DXL script to accomplish just about anything the user can do while sitting in front of the machine. For example, creating a temp directory and making it hidden:
DXL
string folder = "C:\\path\\to\\directory" mkdir(folder) system("C:\\windows\\system32\\cmd.exe /c attrib +h " folder)