Monday, April 20, 2009

A script to check remote computers for directories

At work we needed a way to check servers to see if certain software had been installed. The easiest way was to check for the software's installation directory. There isn't an easy way to do this remotely, though, so I wrote a script to take care of it: dircheck.vbs.

While I was writing this tool I learned a lot about VBScript. For starters, you can't interact with stdin or stdout using the default VBS command interpreter. If you try to write information to the user's console it will display everything in a popup. To fix this, you can use the special cscript interpreter:

cscript dircheck.vbs

If you execute the above command you will get command line help for the utility. Full source code is obviously included, so please feel free to use it however you need to.

No comments:

Post a Comment