soh Posted October 6, 2016 Share Posted October 6, 2016 Hello everyone,I'm new on Autoit and I'm trying to run two variables, one with parameters. Local $go2 = @AppDataDir & "\test\file2.exe" Local $go1 = @AppDataDir & "\teste\file1.exe" if fileexists($go2) then ShellExecute ('"$go1" /parameters1 /parameters2', ($go2)) Exit else msgbox(0, "My Test", "File not found" & @LF & "My url") endif This should run like this (exemple): "path1/file1.exe /parameters1 /parameters2" "path2/file2.exe" But, dont work. Please, help-me. thanks! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 6, 2016 Moderators Share Posted October 6, 2016 (edited) @soh Your variable should not be inside quotes in your ShellExecute statement. It would just be ShellExecute($go1, ...... Edited October 6, 2016 by JLogan3o13 "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! Link to comment Share on other sites More sharing options...
soh Posted October 6, 2016 Author Share Posted October 6, 2016 But if i enter the parameters within "Local", also does not work. Ex: Local $go1 = @AppDataDir & "\teste\file1.exe /parameters1 /parameters2" Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 6, 2016 Moderators Share Posted October 6, 2016 (edited) You would enter the parameters in quotes, but not the variable. Like so: ShellExecute ($go1, '/parameters1 /parameters2', $go2) Edited October 6, 2016 by JLogan3o13 "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! Link to comment Share on other sites More sharing options...
soh Posted October 6, 2016 Author Share Posted October 6, 2016 And, not work: ($go1 /param, $go2) Link to comment Share on other sites More sharing options...
l3ill Posted October 6, 2016 Share Posted October 6, 2016 This works: Local $go2 = @AppDataDir & "\test\file2.exe" Local $go1 = @AppDataDir & "\teste\file1.exe" If FileExists($go2) Then ShellExecute($go1, "/parameters1 /parameters2") ShellExecute($go2) Exit Else MsgBox(0, "My Test", "File not found" & @LF & "My url") EndIf Not sure why you would put a executable variable as a parameter for 'workingdir' but if you you want both executables to run then this should do it. My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
soh Posted October 6, 2016 Author Share Posted October 6, 2016 Not work. the truth, is a command line. It has to be run like this: %appdatada%\test\file1.exe /op /sc /nt "%appdata"\test\file2.exe" how can i make it run the command that way (EXACT)? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 7, 2016 Moderators Share Posted October 7, 2016 Try this: Run(@AppDataDir & "\test\file1.exe /op /sc /nt " & @AppDataDir & "\test\file2.exe") "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! 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