usb-flash-drive

How to prevent windows from accessing and detecting new volumes while writing a raw image file to PhysicalDrive?

て烟熏妆下的殇ゞ 提交于 2021-02-10 03:22:09
问题 After lots and lots of try and error I am now able to flash/write a raw image file (containing multiple partitions) to \\.\PhysicalDriveN (SD-Card in my case) by just using Windows Api calls ( see below ). But as soon as I have some explorer windows open and click around, the write process fails ( error 433 ). Another annoying problem are popup messages telling me that a new volume has to be formatted (at the beginning, while I am still writing!) or autoplay asks me to select an action (after

How to detect using c# if a pendrive is plugged into a USB port?

半世苍凉 提交于 2019-12-28 04:59:04
问题 Is there a way to find out when in a LAN anyone plugs in a pendrive to the USB port? Programatically (in C# preferably) or through some tool. Basically I'd imagine a client application sits on each terminal and monitors the USB ports and sends the information to the server. a.) Can I get the details of the file(s) being copied? b.) Is there a way to do this without a client application? EDIT I dont want to disable the USB port entirely. its to be on a need to have basis. Basically just want

How to find my USB flash drive's path with PowerShell

心已入冬 提交于 2019-12-23 04:38:13
问题 I am preparing a ps1 file. It will install some programmes silently. But my programmes' setup files were saved in my USB flash drive. In my ps1 file, cd E:\User\User_Setups This path is my USB flash drive's path. But it will change on the other machine. Maybe G:\, F:\ etc. Naturally, I don't want to change this path for every different machines. How PowerShell find my USB flash drive's path by a command-line? 回答1: I added a VolumeLabel("MyToolBox") to my usb Stick and put following line in

How to find the path of USB which is mounted to android?

倾然丶 夕夏残阳落幕 提交于 2019-12-18 08:46:15
问题 I am working on an android application to read data from USB. The usb can be connected to android with serial port and my app can find it. Now, I want to read data files and folder from USB. I have read many articles. I found that they use this code : Environment.getExternalStorageDirectory(); However in my case, I got that the path is /storage/emulated/0. When I try to read all the files which are contained in the path, I got the following statements: /storage/emulated/0/Android /storage

Error partitioning and formatting USB flash drive in C++

对着背影说爱祢 提交于 2019-12-12 02:38:58
问题 I'm stuck attempting to re-partition and format a USB flash drive using C++, any help would be great! The goal is to re-partition any arbitrary flash drive with a single partition taking the entire space and formatted FAT32 (later options NTFS and EXFAT). This will be done in batch, hopefully with 50+ devices at once, so drive letter access is not an option. I'm able to create a partition, but when I try IOCTL_DISK_SET_PARTITION_INFO_EX to set the format type, it is failing with 0x32, ERROR

Can't write file in USB flash drive with Xamarin Android/Uwp

我的未来我决定 提交于 2019-12-11 18:45:24
问题 I have some troubles. It's about this subject => System.UnauthorizedAccessException : Access to the path “/storage/[Name]/[nameFolder]/[fileName].txt is denied. At System.IO.FileStream etc…. I know this subject is already here in SOF, but I can't find a solution for Xamarin.Android. It's the same for Xamarin.Uwp, no access right. I can't write a file in the root path (from the USB Flash Drive path) = /storage/[NameOfTheFlashDrive] It's the same if I use the Android path = content://com

UsbInterface null for except 1 device

萝らか妹 提交于 2019-12-11 04:42:36
问题 This way I found solution to recognize if the connected device is storage device. I am following this thesis to understand how the USB Communication with Storage device is done. But the main problem I faced is that For all the connected device except the last connected device I am not getting the UsbInterface and so the related UsbEndPoints. Now How can I recognize all other connected storage device. When 3 devices are connected the log I got is: found usb device: UsbDevice[ mName=/dev/bus

UDEV - Run program on USB flash drive insert [closed]

怎甘沉沦 提交于 2019-12-03 12:13:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am trying to get a script to run whenever ANY USB flash drive (not just a specific one) is plugged in to the system and I have been pulling my hair out for about 2 weeks now on and off trying to figure it out. Can anybody help me? (running Ubuntu if that helps). I need to be able to pass the drive serial

UDEV - Run program on USB flash drive insert [closed]

笑着哭i 提交于 2019-12-03 02:37:19
I am trying to get a script to run whenever ANY USB flash drive (not just a specific one) is plugged in to the system and I have been pulling my hair out for about 2 weeks now on and off trying to figure it out. Can anybody help me? (running Ubuntu if that helps). I need to be able to pass the drive serial number and the devpath (/dev/sd**) at bear minimum. SpliFF First you need your rule to detect usb storage devices /etc/udev/rules.d/10-usbmount.rules: KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", RUN+="/usr/bin/usbdevinserted" This runs our custom executable shell script

How to identify UNIQUELY a USB Device?

扶醉桌前 提交于 2019-12-02 23:09:12
Is it possible to identify a USB device by a unique identifier like an Operating system has Mac-ID, Harddisk ID, Ethernet card ID has unique identifiers? I know one can easily change the volume serial number of USB partition or it could be changed when user Formats it. But is there an ID some kind of 'USB Harddisk ID or USB Hardware ID' which could be retrieved via MFC's (Visual C++ or C#) using the WMI Service? Will such an identifier be unique to the physical device? Kindly clarify... The closest equivalent of a "unique number" available in any USB device is the VID and PID, the vendor and