Sign in to follow this  
Followers 0
Guest Muestafa1

Assigning an @comspec call to a variable

3 posts in this topic

I have a script that will launch multiple setup routines based on what apps a user selects to have installed.

I use a loop that goes through an array of check boxes and an array of executable paths to do the install.

I'm able to launch a .vbs using the following line outside of the loop

RunWait(@Comspec & ' /c cscript.exe "' & "\\appserver\applications\setups\setups.vbs")

I would like to be able to launch setup.vbs using my loop by setting one of the applications paths values in my array to be equal to the values in the parenthesis above. The only combination i could get to compile was the syntax below (using ' as seperators instead of "), but it doesn't run the .vbs file, instead it throws an error. The loop will work fine with more standard paths such as $appPath[1] = "\\appserver\applications\app.exe". Can any quote masters please help me to get this run?

Thanks for your help!

Code snipet:

$appPath[9]= "@Comspec & '/c cscript.exe ' & '\\appserver\applications\setups\setups.vbs'"

msgbox (4096,"test", $appPath[9])

for $i = 0 to $appscount

if GuiCtrlRead($appcheckbox[$i]) = $GUI_CHECKED Then

$path = $appPath[$i]

Runwait($Path)

endif

next

Share this post


Link to post
Share on other sites



$appPath[9]= @Comspec & ' /c ' & "cscript.exe \\appserver\applications\setups\setups.vbs"


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

$appPath[9]= @Comspec & ' /c ' & "cscript.exe \\appserver\applications\setups\setups.vbs"

<{POST_SNAPBACK}>

Thanks for your quick response!... I actually had that at one time but an error with my checkbox numbering was causing it to look to a non existent path. When I pasted in the code you gave I was still getting the error... now that the numbering is cleared up, it works great! Thanks gafrost!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0