How to start a .bat file in a cmd


#1

Hi,

I want to be able to start a .bat file when I found it with Listary. But I want to start CMD first and then execute the bat-file in the opened CMD rather than just executing the bat file. This has some advantages:

  1. If the bat-file fails you can see what is going wrong. The CMD window will not close when the program exits
  2. You can easily restart the program (CTRL+C to exit the program then arrow up and enter)

I also would like to see that the CMD has the path of the bat file as working-directory.

Can this be done with Listary?

Thanks


#2

Check cmd.exe with /K switch.


#3

I tried this:

new Action

  • Keyword: cmd
  • Path: cmd.exe
  • Param: /K “{action_path}”

And that is basically working, thanks.
But how do I change the working folder?
Now it is always C:\Program Files\Listary>

Thanks


#4

OK, I think it should be this:

Param: /k “cd /d {action_path:parent} & {action_path}”