Home > DeveloperSection > Forums > calling ajaxmin build task from vbscript
Manoj Bhatt
Manoj Bhatt

Total Post:154

Posted on    June-20-2013 1:30 AM

 VB Script VB Script 

 1 Reply(s)
 1004  View(s)
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, False
If 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 objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""C:\Program Files (x86)\Microsoft\Microsoft Ajax Minifier\AjaxMin.exe""")
Set objShell = Nothing

Your help is greatly appreciated.

Vijay Shukla

Total Post:100

Posted on    June-20-2013 5:04 AM

Hi Manoj,

You can try as following 

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

Don't want to miss updates? Please click the below button!

Follow MindStick