| View previous topic :: View next topic |
| Author |
Message |
asoifjwgoiwj Guest
|
Posted: Wed Jul 15, 2009 7:23 pm Post subject: using run with a command line switch |
|
|
i want to run a program and have it run with a switch like
| Code: | | run, program -switch |
I've tried all the variants i can think of anyone have an idea how to run a program with a command line switch |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jul 15, 2009 7:39 pm Post subject: |
|
|
| no i haven't tried that, what does that do? |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jul 15, 2009 7:41 pm Post subject: |
|
|
| i just tried that and it did not work |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jul 15, 2009 7:49 pm Post subject: |
|
|
i'm trying to have the script run wow in a window but the -window switch won't work for me like this
| Code: | | Run, C:\program files\world of warcraft\wow.exe -windowed |
|
|
| Back to top |
|
 |
deleyd
Joined: 08 Mar 2008 Posts: 64 Location: Santa Barbara
|
Posted: Wed Jul 15, 2009 7:53 pm Post subject: |
|
|
If this is not a regular .exe program, then try: | Code: | Run, "%comspec%" /c ""Show Params.ahk" "param one" "param two" "param three"", , Hide
; ^ ^ ^^ ^ ^ ^ ^ ^ ^ ^^
; +---------+ |+---------------+ +---------+ +---------+ +-----------+|
; | |
; +----------------------------------------------------------+ cmd.exe strips off these outer "
|
Otherwise, if it's a regular .exe program, then parameter passing rules are usually:- 2n backslashes followed by a " produce n backslashes + start/end double quoted part
- (2n) + 1 backslashes followed by a " produce n backslashes + a literal quotation mark
- n backslashes not followed by a quotation mark produce n backslashes
- a closing " followed immediately by another ", the 2nd " is taken literally and added to the parameter. (This rule appears to be undocumented.)
(I'm currently working on some detailed documentation for passing parameters using the Run command, which I'll add to my http://www.autohotkey.net/~deleyd/xprxmp/autohotkey_expression_examples.htm) |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jul 15, 2009 7:56 pm Post subject: |
|
|
| err, what's n? |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jul 16, 2009 2:07 am Post subject: |
|
|
| bump |
|
| Back to top |
|
 |
closed
Joined: 07 Feb 2008 Posts: 509
|
Posted: Thu Jul 16, 2009 6:44 am Post subject: |
|
|
// n=2
/// n=3 |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jul 16, 2009 8:53 pm Post subject: |
|
|
| ty |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jul 16, 2009 11:53 pm Post subject: |
|
|
i guess i didn't understand?
| Code: | run, "c:\program files\world of warcraft\wow.exe" "\\-windowed"
|
i've tried alot more than that but alot of them didn't run at all, on the ones that didn't work i got a debug that listed \\windowed as one of my variables so that's a step in the right direction |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jul 16, 2009 11:58 pm Post subject: |
|
|
| and does anyone know a command to get that helpful box up when there's no errors? for debugging |
|
| Back to top |
|
 |
deleyd
Joined: 08 Mar 2008 Posts: 64 Location: Santa Barbara
|
Posted: Fri Jul 17, 2009 7:47 am Post subject: |
|
|
windowed is a variable? use %windowed%
Not quite sure what you want the parameter to be.
Perhaps you want:
| Code: | | run, "c:\program files\world of warcraft\wow.exe" "\\-%windowed%" |
but... I'm not sure what the two slashes are there for. Perhaps you want:
| Code: | | run, "c:\program files\world of warcraft\wow.exe" "-%windowed%" |
However, it's possible wow.exe will include the double quotes as part of the parameter instead of using them as parameter delimiters. They may not be necessary:
| Code: | | run, "c:\program files\world of warcraft\wow.exe" -%windowed% | (depends on what the windowed variable is.)
The thing about Windows OS is the newly created process (wow.exe) is responsible for parsing the command line to extract the parameters. (If the program *.exe is written in C/C++, then the C/C++ compiler which compiles the program secretly adds code to the executable which retrieves the command line and parses it to get the parameters. In this case at least there's a consistent standard.) _________________ http://www.autohotkey.net/~deleyd/xprxmp/autohotkey_expression_examples.htm |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Fri Jul 17, 2009 8:47 am Post subject: |
|
|
| Anonymous wrote: | i'm trying to have the script run wow in a window but the -window switch won't work for me like this
| Code: | | Run, C:\program files\world of warcraft\wow.exe -windowed |
| That works just fine for me after changing "C:\program files" to the appropriate path. However, if you have the "Maximized" option enabled you won't see a titlebar or window borders. Unfortunately there doesn't seem to be an opposite of the -maximized switch.
Btw, I always run WoW in "Maximized Windowed" mode, and I've had no problem resizing the windows via WinMove. |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Jul 17, 2009 4:20 pm Post subject: |
|
|
| lexicos i think that is my problem, thanks |
|
| Back to top |
|
 |
|