I'm trying to register a shell open command via the registry and want to open more than one program, so I tried it like this:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\myFile\Shell\Open\Command]
@="cmd /k calc & notepad & exit"
calc
and notepad
are just an example to demonstrate it.
If I use it like this, the calculator and Notepad are opened, but the command prompt is still open until I close Notepad. If I change it to cmd /k calc & calc & exit
, I get 2 calculator instances and the command prompt is closed as I want it.
Why is it not working with Notepad?
Does anybody know another way to start multiple programs with the shell open command in the registry without having the command prompt stay open?
Best Answer
You can do this by instead using the following command:
Therefore making your
.reg
file into:The reason why
calc
works fine (in Windows 10, but not in Windows 7) is that thecalc.exe
process starts a different process (Calculator.exe
) and then exits, allowing the command to proceed.This isn't so for
notepad.exe
, which means that the command gets stuck there waiting fornotepad.exe
to close.The
start
command is used to start a process in a separate window so thatcmd
can continue with the next step.