logoalt Hacker News

xg15 • yesterday at 10:33 AM • 1 reply • view on HN

> Explorer sets the current directory of the program to the directory containing the thing that you double-clicked

I found the linked article to informative and confirming my suspicion: "The thing that you clicked" doesn't have to be the executable - it could also be a document with the executable registered as launch handler, in which case the current directory will be the directory of the document.

Would be interesting to know how links and items in shell namespaces are handled.


Replies

ptx • yesterday at 10:37 PM

Yup. And since applications load DLLs from their working directory by default, and opening a document sets the working directory... you'd better make sure you never open a document from an untrusted folder.

➕ show 1 reply