Boss007 Posted July 4, 2012 Posted July 4, 2012 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!
Venix Posted July 4, 2012 Posted July 4, 2012 (edited) 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 July 4, 2012 by Venix
LuI Posted July 4, 2012 Posted July 4, 2012 Concatenate your string! $ilocation = "c:" $Path = "tempmyprogram.exe" run ($ilocation&$Path) HTH!
Boss007 Posted July 4, 2012 Author Posted July 4, 2012 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!
Boss007 Posted July 4, 2012 Author Posted July 4, 2012 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now