TechSpot

Automatically execute a file

By jimshoe02
Oct 7, 2009
  1. Is there a way to automatically execute a file every time a folder is opened?
    I'm running Windows 7, by the way.
     
  2. Bobbye

    Bobbye Helper on the Fringe Posts: 16,335   +36

    Please tell me what kind of file you want to 'execute'. Opening a file is what you do to files, so maybe you're referring to something other than a file?
     
  3. jimshoe02

    jimshoe02 TS Rookie Topic Starter

    Yes. I mean an executable file. Like an exe or bat file.
     
  4. LookinAround

    LookinAround Ex Tech Spotter Posts: 6,491   +183

    You can use the Autorun feature when you open a volume (e.g. a Windows drive letter). Not so sure about just any old folder..... Just what is it you are trying to accomplish?
     
  5. Bobbye

    Bobbye Helper on the Fringe Posts: 16,335   +36

    If it's an executable file it should 'execute' when you click on it! I'm at a lost also as to just what you're wanting to do.
     
  6. superty12

    superty12 TS Enthusiast Posts: 413

    Scheduled Tasks

    Use Scheduled Tasks. Post if you need help getting to it.
     
  7. LookinAround

    LookinAround Ex Tech Spotter Posts: 6,491   +183

    They don't want to "click" on it. They want it to run automatically upon opening a "folder" (which i don't think is possible). However, automatically running something like a .bat file is possible when opening a "volume". So question is what they are trying to accomplish

    Scheduled tasks???? Those run based on time-of-day not based on events (e.g. opening a volume or folder). Or am i missing something?
     
  8. Bobbye

    Bobbye Helper on the Fringe Posts: 16,335   +36

    No LookinAround, you're not missing anything. This member has difficulty understand the computer- the usual reply is to 'reinstall/reformat'! Since the member gives his/her age as Age: 9 years old, it would be expected that the knowledge would be limited.

    Jim, I think you are going to have to give us an example of a specific file before we can go any further with this.
     
  9. gguerra

    gguerra TS Maniac Posts: 317

    On XP you can set "Autorun" on a removable drive only, i.e. CD/DVD, Flash Drive etc. Has this changed in Vista or Win7
     
  10. LookinAround

    LookinAround Ex Tech Spotter Posts: 6,491   +183

    I think that's incorrect. You can create and use an autorun.inf file in the root directory of any mountable volume (note: mountable doesn't mean removable. Your HD can be partitioned to contain different mountable volumes that aren't removable)

    My understanding is Autorun applies to volumes.
     
  11. gguerra

    gguerra TS Maniac Posts: 317

    After doing some reading you are correct. You can have an autorun.inf located in the root folder of hard drives. This does seem to cause problems however and in fact this is how certain viruses install themselves. When using Windows GUI there is no "Autoplay" tab for drive properties for hard drives, only removable drives.

    My suggestion to the original poster was going to be to use the subst command to "map" a folder to a drive letter than to use the autorun feature on that drive letter. He would have to open the drive and not the folder for this to work.
     
  12. LookinAround

    LookinAround Ex Tech Spotter Posts: 6,491   +183

    That would be a clever approach :) Now let's see what it is they're trying to accomplish...
     
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...