#### calling ajaxmin build task from vbscript

Total Post:154

Points:1086

1801  View(s)
Ratings:
Rate this:
Hi Expert,

I have a java script file which I wanted to have minification and compression on so I found this site http://ajaxmin.codeplex.com . I can use the command line to perform the procedure on my java script file but I was wondering if it is possible to do that with VBScript. Has anybody used this tool before .I want this to work inside my script in which I am reading from an external file and creating a new file and wanted to compress it so was thinking if I can do this all in my script itself.In the below code I am just reading and writing to the txsOutPut file. I wanted to compress this file..I can run the command line ajaxmin test.js -o test.min.js and get the result but wanted to do this inside the script iteslf.
Set req = CreateObject("Msxml2.XMLHttp.6.0")req.open "GET", strInputPath1, Falsereq.sendIf req.Status = 200 Then     txsOutput.Writeline req.responseText

Edit: Just found out that we can call the exe's directly from the script like below..so the question is how do I pass in parameters when running the exe

Dim objShellSet objShell = WScript.CreateObject( "WScript.Shell" )objShell.Run("""C:\Program Files (x86)\Microsoft\Microsoft Ajax Minifier\AjaxMin.exe""")Set objShell = Nothing

1. ##### Re: calling ajaxmin build task from vbscript

Hi Manoj,

You can try as following

objShell.Run """C:\path\to\some.exe"" param1 param2 ..."