Hi,
Is there a way to make a call back to the original CMD.EXE that spawned my program?
Basically, I'm trying to write a console app, which does a heap of work to return a value, and along the way, it may change directory and/or drive. What I would like, is when it exits, to leave the prompt in the same drive:/directory in which the program found itself last.
As expected, the program basically gets its own environment when it starts, and when control is handed back to CMD.EXE, the prompt is in the same folder as whence it started. This to me, is actually completely expected behavior. What I'm looking for, is a way to override this.
I have thought of somehow trying to wrap this up in a batch file, however the two issues are firstly, the program has to also return a second result, and secondly, although I'm already breaking the logic up over binary code and a batch file, I want as much as possible in the binary code.
Perhaps think of this as a fancy CD/CHDIR command.
If anyone can point me in the right direction, I would be most appreciative.
Currently, I have code written in C++, but at the end of the day, I'm happy to re-write in C, C#, Rust, or Go at a minimum.
Thanks!
Jason.
What I have tried:
C++ and a couple of different libraries, C$