Game Development Community

Pesky .dso files

by Derek Kittrell · in Torque Game Builder · 05/15/2005 (11:46 am) · 2 replies

I had to link to an external file because it doesn't seem to like something in my post.
home.neb.rr.com/imperfection/delete.vbs.txt

My scripts are split into dozens of .cs files, so when Torque compiles them, my folders are insanely cluttered by .dso files, which makes it a bit of a pain to search for a particular script. Also, I find it a bit frustrating when a .dso won't recompile. Even if the scripts will cause the program to crash, at least I'd know something was wrong.

In order to alleviate those minor (and at times major) irritations, I made a small vbscript that simply deletes all .dso files in a specified sub-folder, runs Torque, sleeps for 5 seconds to allow the .dso files to be rebuilt, then sets the hidden attribute on the files.

Of course, since this is VBScript, this will only work for Windows. In order for this to work for you, all you need to do is change both instances of "server" to your sub-folder, change "IIFS.exe" to the .exe or shortcut that runs your game and save the whole thing as a .vbs file.

If you have other types of files you want to either hide or delete, just add them to case statements in either sub. If you were to add a gui~ file (for those who use jEdit), you would simply add "GUI~ File" (case sensitive) to a case statement.

As with anything that deletes files, make sure you backup anything before trying it, and make sure you run the script from the correct folder (although it will fail if it cannot find a folder of the specified name). Another note, while this script is very straightforward, I believe most antivirus programs are likely to flip out upon spotting ANY .vbs file, so keep that in mind.


Hopefully someone finds this at least slightly useful.

Edit: Thanks to Smaug to pointing out that I should use file type insead of name.

#1
05/15/2005 (1:38 pm)
Since you're running Windows, wouldn't it be easier to simply sort the file list by type rather than name?
#2
05/15/2005 (2:22 pm)
Yes, indeed. I had been using a similar script to search for actual strings in the file rather than extension and just modified it instead of thinking about type. But the script has been updated to use type now. Thanks.