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
Benway

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
SquonkSC

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
Benway

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
W7 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
nicatronTg

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
monotone

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
fletcher

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
Ztruker

Windows 10 Pro 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
fletcher

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
WindowsStar

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
monotone

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
Thread Forum
USB autorun
when my USB is plunged or is opened in the file explorer i want a bat file run how would i do this
General Discussion
DVD/CD won't autorun
I'm pretty sure I have set all the options so that the disks _ought_ to autorun but they won't. I have to go into Powerdesk (File Manager) and select a vob file. I' installed a codec package but that made no difference. I have had problems with this drive, Samsung TSST CDDVDW 288BB, in fact...
Hardware & Devices
No Autorun?
OK, so I'm not sure why this is happening... For some reason it seems that autorun prompts are entirely disabled on my laptop, I'll put in a CD and nothing happens, I plug in a hard drive and nothing happens, etc. I don't get the options window like I did before I did a clean install. I even...
General Discussion
Windows7-Autorun
Hello I would like to know how to set the Autorun on TSSTcorp DVD+-RW TS-H653G Drive. When i put in the CD or DVD i want it to run. I have to click on my computer and then go to the set up folder to make it run. Thanks for your help:geek:
General Discussion
How to Autorun USB on Win 7
Hi, I want to make a USB flash drive auto run a website link in Windows 7. I know the auto run function has been removed in Win 7, but can I at least make a pop up window appear whenever a USB flash drive is inserted in the PC and have the user the option to click and open the link??? ...
Software
Autorun.dll
Is missing or corrupted.. anyone have this prob..? I have dl'd and burned the iso 2x and have the same prob. let me say that in order to burn iso..i have just renamed the longnamed file to (the longname).iso i have been dl'ing it with ff and it is adding a ,dlm to the file and i have just been...
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 10:32.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App