is it possible that a USB automatically start when i plug it in a PC? - usb-drive

i want a system that can make that a script is automatic start in the moment i put my USB in a PC.
i can not make anything on the PC than plug in a USB.
is that possible?
something like a rubber ducky

Related

Detect changes to COM ports in a script?

Context: I have many embedded devices that communicate with my Windows 11 PC via USB. Each device has its own COM<n> port.
Problem: When I want to launch a terminal emulator (e.g. puTTY, TeraTerm, or CoolTerm) on a specific embedded device, I must unplug its USB cable, run mode to get the list of available COM ports, plug the USB back in and run mode again to see what's changed. Needless to say, this is a royal pain.
So:
Is there a Windows utility that will give me a "growl" or "ToastNotifier" style window when I unplug or re-plug a USB serial device?
If not, is there a Windows utility or mechanism that generates some kind of event when the USB chain changes?
The only other alternative I can think of is to write a Python script that uses PySerial or calls mode periodically and captures and diffs its output. But if I have to poll regularly, it may be rather compute intensive, and it would have to poll frequently in order to be useful.

I want to use Autorun on USB Drive to open a pptx file stored in the USB Drive

I want to open a PowerPoint file when I plug in the USB Drive. I know that there is something called Autorun, but I do not know how to make it open a file in my USB Drive.
Windows had a built in feature where you could set a USB to auto run on any machine when it was plugged in. It would usually prompt the user if they wanted to run the files. but some clever fellows figured out how to bypass this prompt and used it to maliciously run code from the USB as soon as it was plugged in. Windows 10 patched out the ability to auto run flash drives meaning that without finding a work around it is unlikely that you will get a USB to auto run.

How to autorun a .exe file from a usb without using autorun.inf?

I am designing a security utility for USB sticks that when a memory stick has been plugged in,an email is sent to the user with the computer's name and IP address. I have got the email part working, but do not know how to execute the .exe file I have made when the USB is plugged in. I know autorun.inf hasn't worked for a while now, and I would like it to run automatically regardless of the PC it is plugged into. Any suggestions? Thanks.
I am pretty sure there is no way to store an executable onto a USB mass storage device in such a way that it runs automatically on all Windows PCs, because that would be a security risk.
You can configure Windows to use AutoPlay though: go to Settings > Devices > Autoplay.
If you have control over the firmware of the USB device, you might try emulating an HID keyboard and taking control of the user's computer that way. See BadUSB and USB Rubber Ducky.

Ejecting non-storage USB devices on Mac

I have a Mac running VirtualBox with a Win 8.1 client VM.
I have a program to run in the VM that requires access to a USB dongle — note, not a storage device! Sadly, whenever the Mac restarts it grabs the dongle, so before the VM can use it remote hands must physically remove it from the Mac and plug it in again.
Is there some way to programmatically eject (virtually, not physically of course) such a USB device from the Mac so that the VM can then take over ownership? I'll be happy to dig into I/O Kit or whatever Framework in Cocoa may be needed to accomplish this. I'd just rather not start if it's obviously impossible.
This question and answer is similar to what I'm looking for, but Step 6 is "Remove the USB device from your physical machine." I'm trying to avoid fiddling with the physical hardware by hand so that I can automate the process.

Is there any way Not to detect USB from windows PC?

Is there any way Not to detect USB from windows PC?
The USB device should not mount on windows PC ,It should be handled by my application..
Suggestions please...
As far as I know there is no way of stopping the mount on the windows PC, however, you could set it up to autorun so that when it is plugged it in attempts to launch your application. This answer has some information on how to do this: https://stackoverflow.com/a/255067
There is also the option to hide a drive in windows by removing is drive letter (http://www.howtogeek.com/97203/how-to-hide-a-drive-in-windows-so-that-no-one-will-know-its-there/) however, this is almost certainly going to stop your application from reading it too.
If this is for a specific security reason then perhaps you could look at encrypting the drive and allowing only the application to decrypt the data. Thus, whilst mounted in windows it will be of little use.
Sorry I couldn't be of much more help.
Microsoft provides a utility called devcon for free download.
It's a "Command Line Uility Alternative to Device Manager".
It can actually do many things that I won't get into here, but removing a plug & play device is a simple operation once you know the unique name of the device you want to manipulate.
Refer this to check how to work with it.
It sounds like you don't want your device to show up as a drive in My Computer. In that case, why are you using the Mass Storage Device class at all? You could make a custom, vendor-specific device and talk to it using control/interrupt/bulk transfers with WinUSB. You would need to change the Device's USB descriptors to indicate it is a vendor-specific device and not a mass-storage device.

Resources