USB autorun in W7

Benway

New member
Local time
12:42 AM
Messages
26
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_stuff/windows_7_autoplay/
-b
 

My Computer My Computer

OS
xp/Windows 7
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 Computer My Computer

OS
Win7 Build 7600 x86
CPU
Pentium II 300MHz
Motherboard
Asus
Memory
32mb EDO RAM
Graphics Card(s)
Diamond Viper
Sound Card
Soundblaster 16
Monitor(s) Displays
14" AOC CRT 16K color
Screen Resolution
800x600
Hard Drives
300mb Quantum fireball
PSU
110 Watts
Cooling
Passive
Keyboard
Trust Ergonomic
Mouse
Generic
Internet Speed
256K u 128K d
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 Computer My Computer

OS
xp/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 Computer My Computer

Computer Manufacturer/Model Number
Custom
OS
Windows 7
CPU
2.22GHz Intel Core Duo
Motherboard
Custom
Memory
2GB
Graphics Card(s)
nVidia GeForce 8600GT
Monitor(s) Displays
Sceptre 22"
Screen Resolution
1680x1050
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 Computer My Computer

OS
Windows 7
:(

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 Computer My Computer

OS
Win 7 Ultimate
none of the above worked for me

Did you try creating shortcuts to the PAs on the USB drive? What didn't work?
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
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 Computer My Computer

OS
Win 7 Ultimate
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
 
Last edited:

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
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 Computer My Computer

OS
Windows 7
If you run the script in Powershell ISE interface it works perfectly. If you schedule it it works perfectly. It should be good.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
Back
Top