lattey Posted May 22, 2017 Share Posted May 22, 2017 (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 May 22, 2017 by lattey Link to comment Share on other sites More sharing options...
Floops Posted May 22, 2017 Share Posted May 22, 2017 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") Link to comment Share on other sites More sharing options...
lattey Posted May 22, 2017 Author Share Posted May 22, 2017 yes, i already tried that, it show error for both. Link to comment Share on other sites More sharing options...
Subz Posted May 22, 2017 Share Posted May 22, 2017 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") Link to comment Share on other sites More sharing options...
lattey Posted May 25, 2017 Author Share Posted May 25, 2017 thanks guys. im using the solution from subz and it works perfectly. Link to comment Share on other sites More sharing options...
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