Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...



Terrible 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 ...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: