0

I have added a .bat file to the context menu of .avi files with the following .reg file:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\avi_auto_file\shell\RemuxvideotoMKV]
@="Remux video to MKV"
[HKEY_CURRENT_USER\Software\Classes\avi_auto_file\shell\RemuxvideotoMKV\command]
@="\"C:\\Program Files\\MKVToolNix\\Remux video to MKV.bat\" \"%1\""

It works. I now want the .bat file to start minimized.

I found an answer for almost exactly the same problem here, but I don't understand the syntax, as it refers to a slightly more complex command.

firewater
  • 3
  • 1
  • 2
  • I think you want to precede your MKV.bat with a call to `start`, https://ss64.com/nt/start.html, specifying /MIN and taking the advice to include a title. – pbhj Jun 16 '18 at 19:02
  • Thanks. This is as close as I got to building something out of that: `@="start "Remux video to MKV" "C:\Program Files\MKVToolNix\" /min "Remux video to MKV.bat"`, but it doesn't work. – firewater Jun 16 '18 at 19:20
  • 1
    Read [Commands that are Internal to the CMD shell](https://ss64.com/nt/syntax-internal.html). You need to run `cmd /C start …` – JosefZ Jun 16 '18 at 20:47

1 Answers1

0

According to the documentation here the following should work:

[HKEY_CURRENT_USER\Software\Classes\avi_auto_file\shell\RemuxvideotoMKV\command]
@="cmd /C start \"remux\" /MIN \"C:\\Program Files\\MKVToolNix\\Remux video to MKV.bat\" \"%1\""

start starts a batch or program, the /MIN switch starts the program minimised. There's also a /B to run without creating a new window.

As @JosefZ pointed out because start is part of the cmd shell (dotted entries in that link) it needs to be run from cmd.

pbhj
  • 136
  • 2
  • 14
  • Thanks. How would this work without calling for "vanilla CMD"? I actually have ConEmu set to handle all .bat files with this .reg file: `[HKEY_CLASSES_ROOT\batfile\shell\open\command] @="\"C:\\Program Files\\ConEmu\\ConEmu64.exe\" /cmd \"%1\" %*"` and using the command you provided indeed works, but CMD pops up for a second and then minimizes into the taskbar, while opening minimized with ConEmu would have no popup and minimizes to the system tray, making the entire process completely silent. – firewater Jun 16 '18 at 23:37
  • 1
    I'm going to mark it as solved on the basis that it does solve what I asked. ConEmu is, I suppose, a further problem that applies to very few people. Thank you again. – firewater Jun 17 '18 at 22:39