Page 1 of 1

How to correct command in program argument in Run

Posted: 31 Aug 2019, 09:07
by MIRKOSOFT
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

Re: How to correct command in program argument in Run

Posted: 31 Aug 2019, 10:50
by wolf_II
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.

Re: How to correct command in program argument in Run

Posted: 31 Aug 2019, 17:34
by MIRKOSOFT
Helped not - but thank you for correction.

Miro

Re: How to correct command in program argument in Run

Posted: 01 Sep 2019, 10:11
by Ahk_fan

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: `"

Re: How to correct command in program argument in Run

Posted: 03 Sep 2019, 22:02
by MIRKOSOFT
Hm, but now it hangs only...

Miro

Re: How to correct command in program argument in Run

Posted: 04 Sep 2019, 09:19
by Ahk_fan
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.

Re: How to correct command in program argument in Run

Posted: 04 Sep 2019, 18:51
by MIRKOSOFT
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

Re: How to correct command in program argument in Run

Posted: 05 Sep 2019, 02:26
by Ahk_fan
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)

Re: How to correct command in program argument in Run

Posted: 06 Sep 2019, 18:12
by MIRKOSOFT
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

Re: How to correct command in program argument in Run

Posted: 15 Sep 2019, 17:50
by MIRKOSOFT
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