[Resolved] RunProgram with CHDIR
Posted: Fri Aug 08, 2025 10:59 am
Hello everyone,
I'd like to exit my Windows console program with a CHDIR /D <path>.
doesn't seem to work. In fact, CMD.EXE runs on top of the existing CMD.EXE.
So, if you execute an EXIT, you'll be taken to the previous CMD and its location.
SetCurrentDirectory(DirLoc) doesn't work either.
Following A.I.'s advice, I tried creating and running a batch file, but nothing worked. What's more, Google Gemini told me it wasn't possible.
Any other suggestions?
I'd like to exit my Windows console program with a CHDIR /D <path>.
Code: Select all
RunProgram("cmd.exe", "/K CHDIR /D " + DirLoc, "")
So, if you execute an EXIT, you'll be taken to the previous CMD and its location.
SetCurrentDirectory(DirLoc) doesn't work either.
Following A.I.'s advice, I tried creating and running a batch file, but nothing worked. What's more, Google Gemini told me it wasn't possible.
Any other suggestions?