Autorun batch file on external hdd?


  1. Posts : 3
    Windows 7
       #1

    Autorun batch file on external hdd?


    Hey,
    I recently bought an external HDD to back up my files. I wrote a simple batch file to automatically backup files when its plugged into a pc.
    Its only after writing this and playing around with an autorun.inf that I realised that autorun is disabled in windows 7 for usb devices.

    Is there any workaround for this? I only need this to work on 3 computers so I've no problems installing additional software, changing registry keys or whatever is need to do to these computers to get it working.

    Thanks
      My Computer


  2. Posts : 303
    Windows 7 Ultimate
       #2
      My Computer


  3. Posts : 3
    Windows 7
    Thread Starter
       #3

    I looked at that but thats not the problem autoRun is enabled but you can't get your own autorun.inf to run from a usb drive on windows 7
      My Computer


  4. Posts : 303
    Windows 7 Ultimate
       #4

    From Using AutoRun with a USB Flash Drive / USB stick (SamLogic CD-Menu Creator - Article)

    How to launch a program in Windows 7

    In Windows 7 it is not possible to use the ACTION command and the OPEN command together with USB flash drives anymore. Microsoft has removed this support for security reasons. These commands are still available for CDs and DVDs in Windows 7, but not for USB sticks.

    Specifying your own label and icon for the USB flash drive via the Autorun.inf file is still possible, but it is not possible to allow a user to execute a program on the drive via the AutoPlay dialog box. And automatically executing a program on a USB flash drive by turning off AutoPlay and only using AutoRun is not possible either. The OPEN command is not supported at all for USB flash drives in Windows 7.

    To execute a program the user must open Windows Explorer and manually run the program. Luckily an option to start Windows Explorer is always shown in the AutoPlay dialog so it is easy to start Windows Explorer. But to make it also easy for the user to find your program on the USB flash drive (the program you want the user to start when plugging in the USB stick) you should always place the program on the root folder of the drive and give it a descriptive name such as "StartMe.exe", "Autorun.exe", "Menu.exe" etc. This program file should also be the only executable file in the root folder, otherwise some users might start the wrong program by mistake.

    More information about the changed behavior for AutoRun and AutoPlay in Windows 7 can be read in the following article on our Internet site: Using AutoRun / AutoPlay with a USB Flash Drive in Windows 7.
      My Computer


  5. Posts : 2,737
    Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
       #5

    z3r0sum said:
    Hey,
    I recently bought an external HDD to back up my files. I wrote a simple batch file to automatically backup files when its plugged into a pc.
    Its only after writing this and playing around with an autorun.inf that I realised that autorun is disabled in windows 7 for usb devices.

    Is there any workaround for this? I only need this to work on 3 computers so I've no problems installing additional software, changing registry keys or whatever is need to do to these computers to get it working.

    Thanks
    There are several work arounds for this but they all involve 3rd party software or writing a script etc. I have a script somewhere that runs at log on and then checks if a new USB flash drive has been inserted and then runs whatever you like. Not the most glamorous way to do it, but it works on a SMALL amount of machines. Let me know if you wish to go that route and I will dig in the archives for it.

    Edit: Better yet check out Cobain Backup it works great!!!

    http://www.educ.umu.se/~cobian/index.htm
      My Computer


  6. Posts : 3
    Windows 7
    Thread Starter
       #6

    There are several work arounds for this but they all involve 3rd party software or writing a script etc. I have a script somewhere that runs at log on and then checks if a new USB flash drive has been inserted and then runs whatever you like. Not the most glamorous way to do it, but it works on a SMALL amount of machines. Let me know if you wish to go that route and I will dig in the archives for it.

    Edit: Better yet check out Cobain Backup it works great!!!

    Cobian's site
    Thanks man,
    I'd prefer to use the batch file that I wrote instead of 3rd party software to backup the files because I have it set up and working on all 3 computers.

    Any chance you'd have a link to any workarounds or any 3rd party software?
      My Computer


  7. Posts : 2,737
    Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
       #7

    z3r0sum said:
    Any chance you'd have a link to any workarounds or any 3rd party software?
    Sorry I don't have anything handy. I'd give it a google search and I am sure you will come up with something that works for you.
      My Computer


  8. Posts : 1
    Win7 32-bit Ult
       #8

    Launcher.exe - a app I wrote to do just this


    It monitors for new drives and looks for a user defined file on the new drive. It then launches another (or the same) user defined app (or batch file).

    http://www.shrum.net/code/launcher

    You can set the monitor file and the launch file. I personally use the same filename.

    Example: on each of your external devices, place a batch file named mybatch.bat (or whatever filename you want) on the root of your drive. This will be the batch file that you want your system to launch as soon as the drive is seen. Launcher will see the new drive, see the filename it is monitoring for and launch it. Easy-peasy.

    App was written with AutoitScript and code is available...all for free (although I ask of a small donation if you like the app to help with my hosting costs) :)

    Lots of other apps I've written like this at http://code.shrum.net

    Enjoy
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:32.
Find Us