lattey

set multiple path at environment variables in windows and run it using autoit

5 posts in this topic

#1 ·  Posted (edited)

i have one application that need to run under below condition:

1. the application start in at path : C:\NETSL\system\Config

2. the target path is C:\NETSL\system\netsl.exe


if i run the application using only C:\NETSL\system\netsl.exe , the application run differently. 

so, i thinking to set the path at environment variable but nothing happened. 
what i do is i set the variable at control panel - > System -> advanced system settings -> environment variables 
    
 

  variable  name = TEST_PATH
    variable value = C:\NETSL\system\Config;C:\NETSL\system\netsl.exe

and run using autoit:

   

Local $sEnvVar = EnvGet("TEST_PATH")
MsgBox("","", $sEnvVar )
ShellExecuteWait($sEnvVar)

am i doing it wrongly?

i also need to run another application as below:

1. C:\NETSL\system\initnetsl.exe "C:\NETSL\system\Config\Users.xxx"

but i dont know how to called the exe. any idea?

Edited by lattey

Share this post


Link to post
Share on other sites



#2 ·  Posted

Have you tried it like this?

 

ShellExecute("C:\NETSL\system\netsl.exe", "C:\NETSL\system\Config")
ShellExecute("C:\NETSL\system\initnetsl.exe", "C:\NETSL\system\Config\Users.xxx")

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

yes, i already tried that, it show error for both.

Share this post


Link to post
Share on other sites

#4 ·  Posted

Wouldn't the third parameter be the working directory for ShellExecute?

ShellExecute("C:\NETSL\system\initnetsl.exe", "C:\NETSL\system\Config\Users.xxx", "C:\NETSL\system\Config")
Or
Run("C:\NETSL\system\initnetsl.exe C:\NETSL\system\Config\Users.xxx", "C:\NETSL\system\Config")

Share this post


Link to post
Share on other sites

#5 ·  Posted

thanks guys. im using the solution from 

subz and it works perfectly. 

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