Jump to content

help needed using variable to run a program


Recommended Posts

I am a novice at scripting and would like some one to point me in the right direction for the code below

$ilocation = "c:"

MsgBox(0, "", $ilocation)

;how do I run a program using the content of the variable assigned above?

;the line below which i have tried many variations of does not work

;Run $ilocation ("\temp\myprogram.exe")

; the line below is what im trying to achieve using $ilocation in place of the "c:" so that if I change" $ilocation" the install path

; changes

;run ("c:\temp\myprogram.exe")

any help would be appriciated thanks!

Link to comment
Share on other sites

You need to put all the data within the brackets and an amprisand will be used to seperate the two peices of data. Try something like this.

ShellExecute($ilocation & "tempmyprogram.exe") ; We use an amprisand to seperate the two peices of data

You can also use functions such as @DesktopDir to make things shorter for you.

Edited by Venix
Link to comment
Share on other sites

You need to put all the data within the brackets and an amprisand will be used to seperate the two peices of data. Try something like this.

ShellExecute($ilocation & "tempmyprogram.exe") ; We use an amprisand to seperate the two peices of data

You can also use functions such as @DesktopDir to make things shorter for you.

thank you very much for taking the time out it worked!

You need to put all the data within the brackets and an amprisand will be used to seperate the two peices of data. Try something like this.

ShellExecute($ilocation & "tempmyprogram.exe") ; We use an amprisand to seperate the two peices of data

You can also use functions such as @DesktopDir to make things shorter for you.

thanks very much for the explanation it worked!
Link to comment
Share on other sites

thank you very much for taking the time out it worked!

thanks very much for the explanation it worked!

You need to put all the data within the brackets and an amprisand will be used to seperate the two peices of data. Try something like this.

ShellExecute($ilocation & "tempmyprogram.exe") ; We use an amprisand to seperate the two peices of data

You can also use functions such as @DesktopDir to make things shorter for you.

thank you very much it worked!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...