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: USB autorun in W7

19 Aug 2009   #1

xp/Windows 7
 
 
USB autorun in W7

Ok, I know this is a sore subject, but are there any work-a-rounds to get handy programs like PortableApps to at least be an option to run when you plug it in? It kind of defeats the purpose of the whole thing. I'm not plugging in rogue USB sticks from strangers in dark alleys, just my own USB hard drives. It get really annoying when you have to drill into your own drive 20 times a day just to double click the exe to run the dang thing you know is safe.

Someone in another thread posed Autorunner.exe, but it doesn't seem to do anything at all...

http://johnhaller.com/jh/useful_stuf...ws_7_autoplay/
-b

My System SpecsSystem Spec
19 Aug 2009   #2

Win7 Build 7600 x86
 
 

Quote   Quote: Originally Posted by Benway View Post
Ok, I know this is a sore subject, but are there any work-a-rounds to get handy programs like PortableApps to at least be an option to run when you plug it in? It kind of defeats the purpose of the whole thing. I'm not plugging in rogue USB sticks from strangers in dark alleys, just my own USB hard drives. It get really annoying when you have to drill into your own drive 20 times a day just to double click the exe to run the dang thing you know is safe.

Someone in another thread posed Autorunner.exe, but it doesn't seem to do anything at all...

-b
wouldn't a autorun.inf do the trick?

You can search for options and syntax of autorun.inf in google.

Just an example of an autorun.inf:

[autorun]
OPEN=custom_setup.CMD
ICON=SETUP.EXE,0

shell\configure=&Configure...
shell\configure\command=SETUP.EXE

Good luck
My System SpecsSystem Spec
19 Aug 2009   #3

xp/Windows 7
 
 

Quote   Quote: Originally Posted by squonksc View Post
wouldn't a autorun.inf do the trick?

You can search for options and syntax of autorun.inf in google.

Just an example of an autorun.inf:

[autorun]
OPEN=custom_setup.CMD
ICON=SETUP.EXE,0

shell\configure=&Configure...
shell\configure\command=SETUP.EXE

Good luck
Windows 7 ignores autorun.inf now. The most it will do is open up the drive so you can go find the file and run it manually. Seems like a step backwards in technology to me. "if you can't fix it, disable it" appears to be the rule of the day.
My System SpecsSystem Spec
.


19 Aug 2009   #4

Windows 7
 
 

autorun.info was disabled to prevent abuse and viruses, like the USB switchblade from being used(Open files on folder - install malware).

That update is also being pushed to Vista and XP soon. The obvious issue was that social engineering made it possible to spread malware fairly quickly.

On topic, just create a shortcut to StartPortableApps.exe and don't try to open it if the drive isn't in.

(You can always manually open the root of the drive and start it).
My System SpecsSystem Spec
10 Jan 2010   #5

Windows 7
 
 

Hi.

It maybe be a little on the technical side, but I have posted an alternative solution using a powershell script here and/or here.

Of course it's a 'per-computer' solution, in fact it writes nothing on your usb key/drive.
My System SpecsSystem Spec
18 Jan 2010   #6

Win 7 Ultimate
 
 
:(

none of the above worked for me

is it possible to create a hotkey like shift + r to run a file?
i know its not perfect but it might work?
My System SpecsSystem Spec
18 Jan 2010   #7

Windows 8 Core X64
 
 

none of the above worked for me

Did you try creating shortcuts to the PAs on the USB drive? What didn't work?
My System SpecsSystem Spec
18 Jan 2010   #8

Win 7 Ultimate
 
 

i dont try shortcuts, and the script written by monotone works
but it only works once, when you unplug it and plug it back in it doesnt work again
is there a way of refreshing it?
My System SpecsSystem Spec
18 Jan 2010   #9

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

I updated the script to use any drive letter and any volume name and use StartUp.cmd on your flash drive. Put anything you want in StartUp.cmd copy it to the root of the flash drive:

#Requires -version 2.0
#Modified 01-18-2010: Use Any Driver Letter & Volume Name: by J. Hill
Register-WmiEvent -Class win32_VolumeChangeEvent -SourceIdentifier volumeChange
write-host (get-date -format s) " Beginning script..."
do{
$newEvent = Wait-Event -SourceIdentifier volumeChange
$eventType = $newEvent.SourceEventArgs.NewEvent.EventType
$eventTypeName = switch($eventType)
{
1 {"Configuration Changed"}
2 {"Device Arrival"}
3 {"Device Removal"}
4 {"Docking"}
}
write-host (get-date -format s) " Event detected = " $eventTypeName
if ($eventType -eq 2)
{
$driveLetter = $newEvent.SourceEventArgs.NewEvent.DriveName
$driveLabel = ([wmi]"Win32_LogicalDisk='$driveLetter'").VolumeName
$driveType = ([wmi]"Win32_LogicalDisk='$driveLetter'").DriveType
write-host (get-date -format s) " Drive name = " $driveLetter
write-host (get-date -format s) " Drive label = " $driveLabel
# Execute process if drive matches specified condition(s)
# if ($driveLetter -eq 'Z:' -and $driveLabel -eq 'Mirror')
if ($driveType -eq 2)
{
write-host (get-date -format s) " Starting task in 3 seconds..."
start-sleep -seconds 3
start-process $driveLetter"\StartUp.cmd"
}
}
Remove-Event -SourceIdentifier volumeChange
} while (1-eq1) #Loop until next event
Unregister-Event -SourceIdentifier volumeChange
My System SpecsSystem Spec
19 Jan 2010   #10

Windows 7
 
 

fletcher: the script is supposed to loop indefinitely without further intervention. If it stopped after one use, maybe there was an error or something. I suggest trying to run it directly from the Powershell ISE interface, or remove the "hidden" option, and check if you see any errors. When running, you should see "Event detected ...." on the screen whenever you plug or unplug something.
My System SpecsSystem Spec
Reply

 USB autorun in W7





Thread Tools



Similar help and support threads for2: USB autorun in W7
Thread Forum
Can't delete autorun.inf General Discussion
Autorun won't work.. Please help Software
DVD/CD won't autorun Hardware & Devices
No Autorun? General Discussion
Win7 Pro 32 Bit - No Autorun General Discussion
How to Autorun USB on Win 7 Software
Autorun.dll Installation & Setup

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 01:03 PM.
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