Page 1 of 1

Set CMD Start Folder

Posted: 01 Jul 2023 19:52
by shimamiya
For command line ops, how I can I set a start folder in the syntax? Thank you.

Re: Set CMD Start Folder

Posted: 01 Jul 2023 20:06
by highend
By running cmd with CD, e.g.:

Code: Select all

text runret("""cmd"" /c CD ""D:\Tools\XYplorer\Data\Scripts"" & ""D:\Tools\@Command Line Tools\git_x64\mingw64\bin\git.exe"" status");
Would I just use "D:\Tools\@Command Line Tools\git_x64\mingw64\bin\git.exe" status you'd get a failure message (because there isn't a git repo in D:\Tools\@Command Line Tools\git_x64\mingw64\bin

Re: Set CMD Start Folder

Posted: 02 Jul 2023 06:53
by shimamiya
Perfect, thank you. Works great.

Re: Set CMD Start Folder

Posted: 02 Jul 2023 07:20
by jupe
In most cases just supplying the directory param to runret will work.