We help IT Professionals succeed at work.

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

MichaelBalack
on
98 Views
Last Modified: 2019-01-10
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.
Comment
Watch Question

Principal Software Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
DevAdminSystem Engineer | .NET Developer | Microsoft MVP | Technical Speaker
CERTIFIED EXPERT

Commented:
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
MichaelBalackSenior System Engineer

Author

Commented:
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,
DevAdminSystem Engineer | .NET Developer | Microsoft MVP | Technical Speaker
CERTIFIED EXPERT

Commented:
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
MichaelBalackSenior System Engineer

Author

Commented:
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.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions