ayatest Posted February 11, 2015 Posted February 11, 2015 I'm still "blind" to coding (tried some combinations but with no luck), so forgive me such.simple questions. While experimenting, I was able to get some folders of interest and define them as custom variables (is this method correct? I tried to read these custom variables via some example messagebox, and they seem to work fine). What I'm stuck with - is the syntax to run the app. Local $sEnvVar = EnvGet("ProgramFiles(x86)") $test = $sEnvVar Local $sEnvVar = EnvGet("APPDATA") $test2 = $sEnvVar Run($test & "subfolder namesubfolder nameapp name.exe") How to fix it and start the app? functional testing. multimedia recording. flowstone. mouseclick, hotkeys and modularity in general.
Moderators JLogan3o13 Posted February 11, 2015 Moderators Posted February 11, 2015 Why not just use the built in macros? Run(@ProgramFilesDir & "\Subfolder\MyApp.exe") or #AutoIt3Wrapper_UseX64 = Y Run(@ProgramFilesDir & "\Subfolder\MyApp.exe") if you want to specify C:Program Files on a 64bit machine. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
ayatest Posted February 11, 2015 Author Posted February 11, 2015 Because I don't know too much on macros yet. But definately I will want to use various types of custom folder paths, defined as custom variables. So the problem I have here is - how to combine a variable that represents some path - with the rest of filepath, and with the Run command. (path string contains spaces as well as you can see) functional testing. multimedia recording. flowstone. mouseclick, hotkeys and modularity in general.
Moderators JLogan3o13 Posted February 11, 2015 Moderators Posted February 11, 2015 The problem in your first post is you're overwriting your $sEnvVar variable. This works just fine for me: Local $sEnvVar = EnvGet("ProgramFiles(x86)") $test = $sEnvVar Local $sEnvVar1 = EnvGet("APPDATA") $test2 = $sEnvVar1 ConsoleWrite($test & "\subfolder name\subfolder name\app name.exe" & @CRLF) ConsoleWrite($test2 & "\subfolder name\subfolder name\app name.exe" & @CRLF) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
ayatest Posted February 11, 2015 Author Posted February 11, 2015 So defining multiple variables is a matter of separate question. Still - when having this: Local $sEnvVar = EnvGet("ProgramFiles(x86)") $test = $sEnvVar ConsoleWrite($test & "folder name1folder name2app name.exe" & @CRLF) it isn't starting the app functional testing. multimedia recording. flowstone. mouseclick, hotkeys and modularity in general.
Solution ayatest Posted February 11, 2015 Author Solution Posted February 11, 2015 ok, works with Run command, single variable. functional testing. multimedia recording. flowstone. mouseclick, hotkeys and modularity in general.
garyf Posted February 11, 2015 Posted February 11, 2015 This also works: $y = @WorkingDir $X=@ProgramFilesDir & "AutoIt3Au3Info.exe" run($X,$y)
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