Sign in to follow this  
Followers 0
ayatest

folder as variable and running the app

7 posts in this topic

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.

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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)

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

ok, works with Run command, single variable.


functional testing. multimedia recording. flowstone. mouseclick, hotkeys and modularity in general.

Share this post


Link to post
Share on other sites

This also works:

$y = @WorkingDir
$X=@ProgramFilesDir & "AutoIt3Au3Info.exe"
run($X,$y)

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