Saturday, April 14, 2007

Publishing My app: Part II

I've cleaned up most of my application. Created a new batch file to test the path of the VBS files and added an argument checked so all I'd need to do is type "runmod.bat 1" and end up running the Defragmentation check on all of our servers.

It was important to be delicate about this issue. I wouldn't want to run it by mistake, and risk stressing the servers during working hours. I created 5 schedules (1 for each module) to run during the early AM.

One of the Modules is a Windows Patch Version check. It transforms an exported XML from LANGuard Security Scanner to a generic XML file. I then have a small script called create_xsl.vbs which reads variables from a config file and creates an XSL file with the relevant information using a template. Sounds pretty tiresome but it works great since now I can write a VBS module file, a config file.. and easily add it to the HTA application without worrying about encoding or re-coding any of the core application.

Related Post: Publishing My App Part I

Wednesday, April 11, 2007

Multi Variable Batch

This is a great example for reading lines through a regular batch file and processing the input at tokens.

Lets say for example you have a file with the following input:

user1 homedir1
user1 homedir2


etc

If you want to, you could add this to your batch file;

for /f "tokens=1*" %%i in (filename.txt) do @echo %%j\%%i


Notice that %%j was not defined, but is automatically assigned a value alphabetically. The output will look something like;

homedir1\user1
homedir2\user2

Publishing My app

So my boss has suggested I start a tech blog about what I really do. So here it is. I'll start it with my task for the day.

I've created this massive HTA application to monitor our servers and produce pretty XML data for easy adaptability. It is mostly complete, now I have to move it to the main station to get it working without any glitches (especially those path errors.. *shivers*).

~Interrupted~

OK, now I have to work on some SQL statements.. sigh.