How to correct command in program argument in Run

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
MIRKOSOFT
Posts: 334
Joined: 23 Sep 2014, 14:29

How to correct command in program argument in Run

31 Aug 2019, 09:07

Hi!

I tried to use Run command for starting program with many parameters with opening currently selected file.
It never opens selected file.

Here's command in AHK:

Code: Select all

Run, "D:\Emulation\Commodore\Kernal64\k128.bat" --vdc-80-startup --vdc-enabled --mmupanel-enabled --cpm64-enabled --int-rom "D:\Emulation\Commodore\_ROMs\ALL\C128\Internal\Megabit internal function ROM-Adapter.BIN"`,MEGABIT --drive10-local-path "D:\Commodore Harddisk"--drive8-type %argument% "%this_path%"
It starts Kernal64 emulator with selected startup screen inserted card with specified ROM, then are inserted variables to use currently selected file in disk and then local directory for disk. I know that is for not-interested in not clear, but I tried to explain parameters.
Variables are:
%argument% = model of disk
%this_path% = path to currently selected file - quotes are for possible spaces in path, in other parts of script always works
Comma is in arguments escaped.

Problem is that it opens not selected file.
I don't know why is variable "%this_path% ignored 'cause %argument% works - I know it by emulator behavior.

Can anybody help me with this not easy problem?
Thank you for all, each help, reply, comments or words.

Miro
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: How to correct command in program argument in Run

31 Aug 2019, 10:50

I have no idea, but it seems to me as if:
  • parameters for batch file are of the form: Space--command-subcommand
Try to insert the missing Space here:

Code: Select all

Run, "D:\Emulation\Commodore\Kernal64\k128.bat" --vdc-80-startup --vdc-enabled --mmupanel-enabled --cpm64-enabled --int-rom "D:\Emulation\Commodore\_ROMs\ALL\C128\Internal\Megabit internal function ROM-Adapter.BIN"`,MEGABIT --drive10-local-path "D:\Commodore Harddisk" --drive8-type %argument% "%this_path%"
maybe that will fix it.
MIRKOSOFT
Posts: 334
Joined: 23 Sep 2014, 14:29

Re: How to correct command in program argument in Run

31 Aug 2019, 17:34

Helped not - but thank you for correction.

Miro
Ahk_fan
Posts: 237
Joined: 31 Aug 2018, 14:34
Contact:

Re: How to correct command in program argument in Run

01 Sep 2019, 10:11

Code: Select all

Run,  %comspec% /c ""D:\Emulation\Commodore\Kernal64\k128.bat" "--vdc-80-startup" "--vdc-enabled" "--mmupanel-enabled" "--cpm64-enabled" "--int-rom `"D:\Emulation\Commodore\_ROMs\ALL\C128\Internal\Megabit internal function ROM-Adapter.BIN`"`,MEGABIT" "--drive10-local-path `"D:\Commodore Harddisk`"" "--drive8-type %argument% `"%this_path%`"""
each option need an own "-option", and at start and end of the command an extra ". if you need a " into the option you have to put a ` befor -->result: `"
regards,
AHK_fan :)
https://hr-anwendungen.de
MIRKOSOFT
Posts: 334
Joined: 23 Sep 2014, 14:29

Re: How to correct command in program argument in Run

03 Sep 2019, 22:02

Hm, but now it hangs only...

Miro
Ahk_fan
Posts: 237
Joined: 31 Aug 2018, 14:34
Contact:

Re: How to correct command in program argument in Run

04 Sep 2019, 09:19

try this:

Code: Select all

Run,  %comspec% /c ""D:\Emulation\Commodore\Kernal64\k128.bat" "--vdc-80-startup" "--vdc-enabled" "--mmupanel-enabled" "--cpm64-enabled" "--int-rom `"D:\Emulation\Commodore\_ROMs\ALL\C128\Internal\Megabit internal function ROM-Adapter.BIN`"`,MEGABIT" "--drive10-local-path `"D:\Commodore Harddisk`"" "--drive8-type %argument% `"%this_path%`"""
you could try with less arguments, perhaps is yout syntax not ok.
regards,
AHK_fan :)
https://hr-anwendungen.de
MIRKOSOFT
Posts: 334
Joined: 23 Sep 2014, 14:29

Re: How to correct command in program argument in Run

04 Sep 2019, 18:51

Hm, again program hangs.

All parameters are req'd for using this combination - program has not yet any config option or file - it is after first release in development.

Miro
Ahk_fan
Posts: 237
Joined: 31 Aug 2018, 14:34
Contact:

Re: How to correct command in program argument in Run

05 Sep 2019, 02:26

you can use /k instead of /c to keep cmd-window open, so you should see the failure.
c(om)m(an)d(line) /k(ept open)

plaese post commandline screenshot directly from console-window (cmd)
regards,
AHK_fan :)
https://hr-anwendungen.de
MIRKOSOFT
Posts: 334
Joined: 23 Sep 2014, 14:29

Re: How to correct command in program argument in Run

06 Sep 2019, 18:12

I got it work, but problem still remains - file is not opened, only empty disk used.

What I did: I modified called BAT file by embedding all parameters into.
Now I'm using only this:

Code: Select all

Run, "D:\Emulation\Commodore\Kernal64\kernal64ahk.bat " --drive8-type %argument% "%this_path%"
Miro
MIRKOSOFT
Posts: 334
Joined: 23 Sep 2014, 14:29

Re: How to correct command in program argument in Run

15 Sep 2019, 17:50

Finally I got it work generally.
It needs not only type of drive selection by

Code: Select all

--drive8-type
but for disk selection it needs separate

Code: Select all

--drive8-file
So, new command is:

Code: Select all

Run, "D:\Emulation\Commodore\Kernal64\kernal64ahk.bat " --drive8-type %argument% --drive8-file "%this_path%"
Miro

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], docterry, Leonardo_Portela, Spawnova and 187 guests