Change the working directory in registry shell open command

3

I need to register an application to a URI scheme and I want the application to run from different working directory, but I couldn't find a way to change the working directory directly in shell open command without opening cmd. So my question is how to specify the working directory in shell open command? I tried @="cmd /k start /d v:\ c\:path\path\myapp.exe app.fmx user/password@database & exit" and it works but I want to do it without using the cmd

X1y2

Posted 2019-10-09T08:51:34.607

Reputation: 31

Did you try start "title" /D path/to/your/working/dir yourprogram.exe ? – Art Gertner – 2019-10-09T08:59:09.157

1Start doesn't work in shell open command dont know why – X1y2 – 2019-10-09T09:37:34.550

1@X1y2 because START is cmd.exe built-in command, not a separate executable. To use START, you must invoke «CMD /C "START "%title%" /D "%dir%" %command%"». Title may be empty, but then you'll still have to invoke start with empty quotes: «START "" /D "%dir%" %command%». Also notice there are surrounding quotes after /C around whole START command, they are mandatory, see cmd /? for /C syntax. However, you'll get blinking command line window as a side effect. – LogicDaemon – 2019-10-09T10:14:03.163

1@X1y2 to get more comprehensive answer, and to ensure it's not an XY problem, please, add an example of specific URI scheme and command you want to invoke to the question. – LogicDaemon – 2019-10-09T10:15:55.790

I tried @="cmd /k start /d v:\ c\:path\path\myapp.exe app.fmx user/password@database & exit" and it works but I want to do it without using the cmd. – X1y2 – 2019-10-10T07:19:37.277

No answers