drive-letter

Retrieve mount point of WPD device

做~自己de王妃 提交于 2019-12-11 03:15:09
问题 I've worked with WPD API for a while now, and I seem to run in to problem after problem. Once I fix one problem, something else pops up. But hey, that's life. I've been trying to determine if a WPD device is a storage device or a phone or whatever. Turns out, devices such as iPhone are not set to be recognized as a phone, but instead as a generic device in terms of WPD_DEVICE_TYPE . But, it is presented to Windows as a storage device. When connecting external harddrives, SD memory card

Detecting Removable drive letter in CMD

别说谁变了你拦得住时间么 提交于 2019-12-08 02:55:32
问题 I'm trying to write a script, which will detect the letter of my USB Removable Drive called "UUI" and then create folder on it. I've written few commands for CMD which, when run separately, work. However when I put them into a bat file, I always get some errors. Here are the commands in a bat file: for /F "tokens=1 delims= " %i in ('WMIC logicaldisk where "DriveType=2" list brief ^| c:\windows\system32\find.exe "UUI"') do (echo %i > drive.txt) set /p RemovableDriveLetter2= < drive.txt del /F

Detecting Removable drive letter in CMD

僤鯓⒐⒋嵵緔 提交于 2019-12-06 13:52:08
I'm trying to write a script, which will detect the letter of my USB Removable Drive called "UUI" and then create folder on it. I've written few commands for CMD which, when run separately, work. However when I put them into a bat file, I always get some errors. Here are the commands in a bat file: for /F "tokens=1 delims= " %i in ('WMIC logicaldisk where "DriveType=2" list brief ^| c:\windows\system32\find.exe "UUI"') do (echo %i > drive.txt) set /p RemovableDriveLetter2= < drive.txt del /F /Q drive.txt set RemovableDriveLetter=%RemovableDriveLetter2:~0,1% %RemovableDriveLetter%: md

Converting a drive letter to a Partition ID / Disk ID

 ̄綄美尐妖づ 提交于 2019-12-05 19:35:16
Given a drive letter, how do I get the OSImage InstallTo Partition ID and Disk ID without using the registry? unixman83 The WMI class Win32_DiskPartition is what I need. Now to figure out how to use WMI to get this information from a drive letter. Win32_LogicalDisk is also useful, MSDN Example , and this stackoverflow answer . Update: Hmm, this doesn't work! Not in the Windows Installer anyway ( WMI is missing from Windows PE !!) so I am using the other answer QueryDosDevice (e.g. \\.\PhysicalDisk1\Partition0 ) and hacking it together. This sucks Microsoft, accept a damn path in your installer

Getting Portable Devices using java

不想你离开。 提交于 2019-12-04 17:31:43
I am trying to access some files in a device (having "windows CE" application in it) that appears as portable device in windows 7 using java applet.... My device path is like "Computer\Attari's Device\myfile.txt" Now i am trying to access file from it using the same address but it gives path error or file not found. Similarly i used "\\.\Attari's Device\myfile.txt" but it resulted in same error tell me how to access portable devices using java applet When i navigate to connected device and right-click on file and see it's properties then it shows it's location as Location: Computer\Attari's

Resolve Windows drive letter to a path (subst and network)

回眸只為那壹抹淺笑 提交于 2019-12-04 06:14:51
I wonder if there is a universal way of resolving a path using a drive letter (such as X:\foo\bar.txt ) into its equivalent UNC path, which might be one of the following: X:\foo\bar.txt if X: is a real drive (i.e. hard disk, USB stick, etc.) \\server\share\foo\bar.txt if X: is a network drive mounted on \\server\share C:\xyz\foo\bar.txt if X: is the result of a SUBST command mapping X: to C:\xyz I know that there are partial solutions which will: Resolve a network drive (see for instance question 556649 which relies on WNetGetUniversalName ) Resolve the SUBST drive letter (see QueryDosDevice