Set CMD Start Folder

Discuss and share scripts and script files...
Post Reply
shimamiya
Posts: 8
Joined: 29 Jun 2023 12:29

Set CMD Start Folder

Post by shimamiya »

For command line ops, how I can I set a start folder in the syntax? Thank you.

highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Re: Set CMD Start Folder

Post 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
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

shimamiya
Posts: 8
Joined: 29 Jun 2023 12:29

Re: Set CMD Start Folder

Post by shimamiya »

Perfect, thank you. Works great.

jupe
Posts: 2669
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Set CMD Start Folder

Post by jupe »

In most cases just supplying the directory param to runret will work.

Post Reply