Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Autorun batch file on external hdd?

24 Mar 2010   #1

Windows 7
 
 
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 System SpecsSystem Spec
.

24 Mar 2010   #2

 

My System SpecsSystem Spec
24 Mar 2010   #3

Windows 7
 
 

Quote   Quote: Originally Posted by Casca View Post
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 System SpecsSystem Spec
.


24 Mar 2010   #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 System SpecsSystem Spec
24 Mar 2010   #5

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

Quote   Quote: Originally Posted by z3r0sum View Post
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 System SpecsSystem Spec
25 Mar 2010   #6

Windows 7
 
 

Quote:
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 System SpecsSystem Spec
26 Mar 2010   #7

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

Quote   Quote: Originally Posted by z3r0sum View Post
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 System SpecsSystem Spec
28 Sep 2010   #8

Win7 32-bit Ult
 
 
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 System SpecsSystem Spec
Reply

 Autorun batch file on external hdd?





Thread Tools




Our Sites

Site Links

About Us

Find 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 02:57 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33