gr8BigGeek Posted July 23, 2011 Share Posted July 23, 2011 Hello all, I am trying to trigger a program to run and it's getting a little punchy. It's not as simply as shellexecute() or run() because when the .exe is opened it has some extra things that need to be opened along with it. So, I'm trying to do what the shortcut does; the shortcut looks like this: Target: C:\folder\program.exe -projPath C:\folder\program.exe C:\folder\ -proj adps -path C:\folderStart in: C:\folderShortcut key: NoneRun: Normal windowI figure I should do something along these lines but my head is getting lost in this for some reason (I think I've been working on it too long...not sure): ShellExecute(@ScriptDir & "C:\folder\program.exe","-a" & chr(34) & "-projPath" & chr(34), $DestinFileName = StringLeft(@ScriptFullPath, 3) & "C:\folder\")Now, I've been playing with my code for a while and it is not working at all. I've gotten everything else to work in my AutoIt program but this one string. Any and/or all help in this would be wonderful. Thanks in advance, A Geek~ Link to comment Share on other sites More sharing options...
Exit Posted July 23, 2011 Share Posted July 23, 2011 ShellExecute("C:\folder\program.exe","-projPath C:\folder\program.exe C:\folder\ -proj adps -path C:\folder","C:\folder") App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
gr8BigGeek Posted July 23, 2011 Author Share Posted July 23, 2011 ShellExecute("C:\folder\program.exe","-projPath C:\folder\program.exe C:\folder\ -proj adps -path C:\folder","C:\folder") I tried: ShellExecute("C:\folder\program.exe","-projPath C:\folder\program.exe C:\folder\ -proj adps -path C:\folder","C:\folder" but I'm getting an "unable to parse" error message? Link to comment Share on other sites More sharing options...
MvGulik Posted July 24, 2011 Share Posted July 24, 2011 (edited) ... but I'm getting an "unable to parse" error message?It might be useful to know from who that error is. From AutoIt (I somehow doubt it), the program you trying to call, or something else all together. Edited July 24, 2011 by iEvKI3gv9Wrkd41u "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
gr8BigGeek Posted July 24, 2011 Author Share Posted July 24, 2011 Might be useful to know from who that error is. From AutoIt* (I somehow doubt it), the program you trying to call, or something else all together.Not entirely sure what you are doubting there; the English reads pretty broken. Regardless (back to the original issue) when trying to run the code I get the following error: "ShellExecute(@ScriptDir & "C:\folder\program.exe","-a" & chr(34) & "-projPath" & chr(34), $DestinFileName = StringLeft(@ScriptFullPath, 3) & "C:\folder\")" ShellExecute(@ScriptDir & "C:\folder\program.exe","-a" & chr(34) & "-projPath" & chr(34), $DestinFileName = StringLeft(@ScriptFullPath, 3) & "C:\folder\"^ERRORError: Error parsing function call."I was posting for constructive/helpful contributors to aid me in learning not for doubtful criticism. If you could provide some assistance in the future that would be wonderful. Thank you Link to comment Share on other sites More sharing options...
MvGulik Posted July 24, 2011 Share Posted July 24, 2011 Not entirely sure what you are doubting there; the English reads pretty broken.I can't help you with the reading part, but I think I can understand what you write. Now lets see. Code-IN:ShellExecute(@ScriptDir & "C:\folder\program.exe","-a" & chr(34) & "-projPath" & chr(34), $DestinFileName = StringLeft(@ScriptFullPath, 3) & "C:\folder\") Code-OUT:>"C:\PROG_CODE\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\_CODE_\AUTOIT\__TMP_3.au3" /autoit3dir "C:\PROG_CODE\AutoIt3" /UserParams +>03:53:51 Starting AutoIt3Wrapper v.2.0.3.0 Environment(Language:0413 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86 OS:X86) >Running AU3Check (1.54.19.0) from:C:\PROG_CODE\AutoIt3 +>03:53:51 AU3Check ended.rc:0 >Running:(3.3.6.1):C:\PROG_CODE\AutoIt3\autoit3.exe "D:\_CODE_\AUTOIT\__TMP_3.au3" +>03:53:54 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 4.664 Result: No error!, other than that the targeted program can't be found of course. (But that's not a AutoIt problem.) So ... Whatever the error is your having at your end. Your posted data is not making it possible to reproduce it. And as such helping you with your code problem becomes somewhat of a guessing game. If you (and others) have no problem with that ... your free to continue that way. (but its not a very effective way of getting a/your problems solved.) I was posting for constructive/helpful contributors to aid me in learning not for doubtful criticism.Well ... maybe you will have more luck with the next poster. If you could provide some assistance in the future that would be wonderful.??? Thank youYour welcome. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 24, 2011 Share Posted July 24, 2011 @gr8BigGeekYou have eyes, right? Look at where the error is and you can't miss the missing bracket. Also stop with Notepad or whatever you use to write your code. If you had run from SciTE then Au3Check would have told you about the error before running the script:C:\Users\Admiral\AutoIt TNG\Från forumet\385.au3(1,121) : ERROR: syntax error ShellExecute("C:\folder\program.exe","-projPath C:\folder\program.exe C:\folder\ -proj adps -path C:\folder","C:\folder" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Admiral\AutoIt TNG\Från forumet\385.au3 - 1 error(s), 0 warning(s) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Developers Jos Posted July 24, 2011 Developers Share Posted July 24, 2011 (edited) What is this bit supposed to do in your command?:ShellExecute(@ScriptDir & "C:\folder\program.exe","-a" & chr(34) & "-projPath" & chr(34), $DestinFileName = StringLeft(@ScriptFullPath, 3) & "C:\folder\") Edited July 24, 2011 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Exit Posted July 24, 2011 Share Posted July 24, 2011 I tried: ShellExecute("C:\folder\program.exe","-projPath C:\folder\program.exe C:\folder\ -proj adps -path C:\folder","C:\folder"but I'm getting an "unable to parse" error message?And where is the closing bracket ? Just learn how to copy and paste. App: Au3toCmd UDF: _SingleScript() 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