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

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.

Related

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.

USB autoruns on mac

I received a direct marketing USB stick on the mail the other day. As soon as I inserted it into my test-Mac - it opened Safari and wrote in the address of a website it wanted to visit. It had the exact same behaviour on my test PC.
Now, I was under the assumption that OSX didn't have an autorun feature. I'm running 10.10.3 and I can't even find the device under disk utility.
Any ideas on how they are doing this? The only thing I can think of is that it's piggybacking on a helper service, but I've never used any products from this company before.
How can I investigate the contents of the USB if I can't find it on my mac?
I can't even find the device under disk utility.
That is beacause it is not a disk device, but a USB HID "keyboard". The stick sends the key codes that will open the website automatically.

Is there any kind of udev equivalent on Windows?

I'm looking for a way to ensure that a USB device plugged into a Windows 7 machine will be mounted in a reliable, repeatable way.
I don't have that much Windows experience, but I wondered if there was a way to make the equivalent of a udev rule in Linux to match certain parameters to identify the device and then mount it on a specific COM port.
Any advice would be gratefully received.
Sarcastic answer:
I've looked for C:\Windows\etc\udev.d but there's no such directory
;)
Less sarcastic answer:
As far as I know, the only way to configure devices in windows is via the device management UI which can be started with mmc devmgmt.msc
This is obviously not even similar or even close to udev, there is no possibility to do this without the GUI.

USB pop-up window?

I am wondering whether it is possible to display a message to the user when he connects a USB device. For example, I want to program the USB so that any PC that the device is connected to displays the pop-up window, saying Please leave the usb on this place.
It is NOT possible;
You wrote: " I want to program the usb so that any PC that the device is connected "
You'd rather program the PC not the USB
USB is a storage device only. Unfortunatelly you can't program all the PC's that USb might get into
The ONLY way this might be (yes it won't work in every case I guarantee) be tweaked is to have autorun.inf file in the USB pointing to a program on the USB that displays the message you want.
[Autorun]
Open=msg.exe
Due to most modern operating systems have tons of blocking mechanism to stop autorun programs this message has very slight chance to appear
You will need to first register for device notification. Then, you can implement a callback to detect when your USB device is inserted or removed. Within that callback you can do your messaging to the users based of your inspection of which device was inserted or removed.
This is only possible if the computer already has a driver installed for this device that implements this behavior. If, as I suspect, the device is actually a standard USB storage device, this is not possible.

How should I get ActiveSync / Mobile Dev Center to recognise my Windows CE device via USB?

We develop a custom Windows CE-based device. To connect this to the PC via ActiveSync / Mobile Device Center, we have to set up entries so that the WCE USB Serial Host (wceusbsh.sys) recognises our Vendor ID (Vid) and Product ID (Pid).
To do this, to date, we have distributed a modified version of wceusbsh.inf and wceusbsh.sys: when the user first connects the device then ActiveSync basically says it does not recognise the device, and the user is asked to identify a driver for it. If they now point at the location where they've stored our wceusbsh.* files then all is well. However this is pretty clunky.
What we really want is a slick way to do this, preferably by running an installer which just gets everything ready, so that as soon as the device is plugged in it is recognised by wceusbsh.sys.
Any clues how to do this? There seem to be a ton of registry entries which relate to WCEUSBSH, and it's not clear how these are set: just "installing" the .INF file doesn't seem to allow for setting them all, so it does look like ActiveSync reads the .INF file and then adds some more information before appending the new info to the Registry.
Thanks
Well, in case anyone else comes looking for an answer to this, we managed to do it via this link from MSDN WinUSB (Windows Driver Kit). We now have a driver install program which sets up USB / Mobile Device Center so that when you plug in the CE device it is recognised correctly.

Resources