Sign in to follow this  
Followers 0
gr8BigGeek

Goofiest Shortcut eVeR!

9 posts in this topic

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:\folder

Start in: C:\folder

Shortcut key: None

Run: Normal window

I 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~

Share this post


Link to post
Share on other sites



ShellExecute("C:\folder\program.exe","-projPath C:\folder\program.exe C:\folder\ -proj adps -path C:\folder","C:\folder")


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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 ...
 

Share this post


Link to post
Share on other sites

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\"^ERROR

Error: 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

Share this post


Link to post
Share on other sites

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 you

Your 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 ...
 

Share this post


Link to post
Share on other sites

@gr8BigGeek

You 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)

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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. :)


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

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