| View previous topic :: View next topic |
| Author |
Message |
Icarus
Joined: 24 Nov 2005 Posts: 507
|
Posted: Fri Sep 19, 2008 12:18 am Post subject: Run/RunWait with parameters not working |
|
|
Either I am too tired or something is wrong...
Trying to call a script/executable with command line parameters but with no success.
Here is a test script which will call itself with a command line parameter.
| Code: |
#SingleInstance Force
exec := A_ScriptName
params = %1%
If( params = "" )
RunWait "%exec%" "hello world"
Else
msgbox %params%
ESC::ExitApp
|
I get an error "failed to launch".
Anyone? _________________ Sector-Seven (Music and Utilities) |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1496
|
Posted: Fri Sep 19, 2008 5:38 am Post subject: |
|
|
| Code: | #SingleInstance Force
exec := A_ScriptFullPath ; not A_ScriptName
params = %1%
If( params = "" )
RunWait %A_AhkPath% "%exec%" "hello world"
; when passing parameters to an uncompiled script, use this method
; since you really shouldn't try to pass parameters to a non-exe
Else
msgbox %params%
ESC::ExitApp |
 _________________ My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags ! |
|
| Back to top |
|
 |
Icarus
Joined: 24 Nov 2005 Posts: 507
|
Posted: Fri Sep 19, 2008 5:55 am Post subject: |
|
|
Thanks man, didnt think about it.
Although, I see no reason why it cannot work without it.
I mean - if you go to command line and run this script, it does work.
C:\>Test.ahk "hello world"
works - so its only a problem of AHK?
Anyways - this is helpful so thanks . _________________ Sector-Seven (Music and Utilities) |
|
| Back to top |
|
 |
|