Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command that can be used in DESKTOP.INI files to open/run a file when the containing folder is opened?

There are already a couple of ways to assign an icon to folders, so being able to have a file in a given folder run when the folder is opened in Windows Explorer, would allow for an easy way for the folder to emulate a self-contained “program”.

share|improve this question

You cannot do this in a world which complains that the ability to hide file extensions is a security hole.

Older Windows versions (starting with 98 or 95+IE4, ending with 2000) had the ability to customize folder appearance by creating a Folder.htt "HTML template", which could use ActiveX and stuff. This has been removed in XP.

share|improve this answer
Yes, I figured that security would be a concern even though the folder can easily be examined and the file renamed through a command prompt (and more importantly, other things like autorun, autoplay, and even folder-shortcuts which have a similar-ish behavior still exist). I never bothered with Active-X, but I am quite familiar with Folder.htt and always wondered why my files that worked in 2000 did not in XP (I had not read of an official it’s been dropped announcment). Oh well, I guess that I’ll just have to either open the folder and double-click the EXE or create a shortcut. :-( – Synetech Apr 25 '11 at 16:12
@Synetech: Autorun only ever worked for optical media. (Still a security hole, but not as much as with USB drives.) The "Run custom program" feature of Autoplay has been restricted the same way, too (hotfixes for XP and up); the rest of Autoplay has always been safe. Folder shortcuts cannot run arbitrary executables. (Although I just managed to dump Explorer into a crash-restart loop while trying.) – grawity Apr 25 '11 at 17:00
I didn’t mean that they are all security holes specifical with auto-running, I meant the whole file-hiding thing. Frankly, this wouldn’t be much of a threat since all of the files are directly accessible; only to really dumb users, which unfortunately seems to be a lot if the ridiculous number of zombies in botnets is any indication. :-| – Synetech Apr 25 '11 at 19:33
Don't expect any J. Random User to be automatically proficient at command line and OS internals just because they are able to turn on a computer. – grawity Apr 26 '11 at 5:12
No, not the user, the security software that checks files for malware. – Synetech Apr 27 '11 at 0:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.