3 ms·
I wrote a "cd" replacement for cmd[1] a _long_ time ago (I only recently uploaded it to Github). It uses exactly this technique to run a thread in cmd's proces
by seligman99 5y ago
I wrote a "cd" replacement for cmd[1] a _long_ time ago (I only recently uploaded it to Github).
It uses exactly this technique to run a thread in cmd's process to actually change the directory. It's kept working from XP on up to Windows 11 now. I am always amazed it works, I fully expect it to go boom some day, probably with an error along the lines of "Don't do that, please".
[1] https://github.com/seligman/ccd/blob/master/RemoteThread.cpp#L416 https://github.com/seligman/ccd/blob/master/RemoteThread.cpp...
- rightbyte 5y agoTerrible hacks is an art form that is hugely underrated today in the name of overengineered best practice complexity monsters. Sometimes, just doing it the stupid way is simpler than doing it properly. Especially when working with propertiary systems ...