Avatar of MichaelBalack
MichaelBalack
Flag for Singapore asked on

How to get the batch file executed upon usb thumb drive plug in?

This is an intention to run a batch file from the usb thumb drive when this thumb drive plug into the desktop or laptop. Targeting MS WIndows  7/10/2008/201. Please see the contents of the autorun.inf as follows,

[Autorun}
ShellExecute=PCChecking.bat
UseAutoPlay=1

The "autorun" didn't seem to fire up.  How to get this automatic function works?

thanks in advance.
Windows BatchWindows OS

Avatar of undefined
Last Comment
MichaelBalack

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dr. Klahn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
DevAdmin

In Windows 7 or above AutoPlay will not support the AutoRun
https://blogs.technet.microsoft.com/srd/2009/04/28/autorun-changes-in-windows-7/

Is security feature that was introduced for contrast Conflicker
MichaelBalack

ASKER
Hi both,

Can Auto Play be used ? So as a screen, with the given batch file presented for running?
Or else, any alternative way with minimal intervention from the user?

Thanks,
DevAdmin

Autoplay is not a best practice... the correct way is start manually

But try explain better your scenario and why you want give to yours users an autostart thumb drive for execute a bat, so we try suggest an alternative solution
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
MichaelBalack

ASKER
Thanks for both experts - Dr. Klahn and Ermanno in pointing out the autorun and autoplay are "prone" to introduce viruses into the PC. Now, I get the user to run the required batch file instead and this works.