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?