Questions tagged [drive-letter]
55 questions
1
vote
2 answers
Get Drive-Letter of Storage Drive By Name/ID in Python
I am trying to create some code that checks if a drive is connected and then edits files on that drive if it is. The issue is that the letter associated with that drive will not always be the same. Is there some way I can check if a drive with a…

Bob Smith
- 220
- 4
- 21
1
vote
1 answer
Slow to unmap network drive letter
When I try to unmap network drive letter mappings using WNetCancelConnection2 (or the depreciated WNetCancelConnection), the thread will block for about 10 seconds before the drive letter is actually unmapped if the file server is unavailable on the…

Matt
- 774
- 1
- 10
- 28
1
vote
5 answers
Use windows drive letters in maven install:install-file
When I try to install a custom jar with the following maven command then it will fail misirably:
mvn -X install:install-file -Dfile=D:\Work\...
Howerver the following does work:
mvn -X install:install-file -Dfile=\Work\...
You might now ask: So…

Martin
- 11,577
- 16
- 80
- 110
1
vote
1 answer
Restrict Drive Letter Selection By Type
I have a form on which a user can select a source drive letter:
If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
TextBox1.Text = FolderBrowserDialog1.SelectedPath
End If
I need to restrict the selection of drive letters to CDROM or…

georgemackenzie
- 171
- 2
- 4
- 19
1
vote
2 answers
Find Available Drive Letter and Change
I am trying to create a PowerShell script that will find an available drive letter, map a network drive, and then change to that mapped drive. I found the following which mapped \\server\share as the D: drive:
$Drive = New-PSDrive -Name…

Brian Weaver
- 41
- 1
- 2
- 4
1
vote
3 answers
Find current diskpart volume number in .bat
Using a .bat script on an USB drive I'd like to change it's drive letter without using 3rd party software and any requirements on the system where the USB is plugged in except that it's Windows XP or higher.
To get the current drive letter I…

RapidFireArts
- 83
- 1
- 11
1
vote
3 answers
Powershell: Grab USB Drive letter
I am trying to figure out a Powershell command that would allow me to capture the drive letter of the only USB drive plugged into the computer, and then be able to recall that variable like this:
dir %usbdrive%
I have used this command to show the…

Caleb Abernathy
- 11
- 1
- 2
1
vote
1 answer
Why does _splitpath_s() take custom sized string buffer for returning drive letter?
A small detail caught my eye while reading documentation of _splitpath_s(). It takes path of a disk item (e.g.; C:\Temp\MyFile.exe) in its 1st parameter, and then splits it into drive, directory, folder and extension names. However, the strange…

hkBattousai
- 10,583
- 18
- 76
- 124
0
votes
1 answer
IMAPI2 How to to associate the UniqueID with the drive letter
I have the following code:
foreach (string uniqueRecorderID in discMaster)
{
MsftDiscRecorder2 discRecorder2 = new MsftDiscRecorder2();
discRecorder2.InitializeDiscRecorder(uniqueRecorderID);
…

sparky
- 375
- 6
- 22
0
votes
1 answer
Assign drive letter to CD-Drive using PowerShell
I have a CD drive, without a drive letter, because I am trying to automatically rearrange Volumes. I want to use PowerShell a drive letter to the CD drive (here ISOIMAGE).
I removed it using the following:
$cdDrive = Get-WmiObject -Class…

Omglolyes
- 156
- 11
0
votes
1 answer
How to navigate to a file in an unknown drive letter (powershell)
I'm trying to create a script on a Flashdrive to run several commands on all of our company computers. In this specific part I'm trying to run commands for AVAST to run a virus scan and do updates at 10 pm. The problem i'm running into is: in order…
0
votes
1 answer
how to assign output from command to variable in command prompt
I have these two commands
C:\Users\xyz\AppData\Local\Temp>WMIC LOGICALDISK where volumename="abc" get deviceid>%temp%/path.txt
which creates file path.txt with content:
DeviceID
F:
the file has lots of additional spaces which I have added in…

kidders
- 13
- 6
0
votes
0 answers
C++ Problem not return network drive (Z:/) , with running the program in RunAsAdmin mode
I have written a program to display the available drives.
I want this program to work on all versions of Windows.
I have a problem, when I run the program with RunAsAdministrator, it does not display the sharing drive. How can I solve this…
0
votes
1 answer
Preventing office from using MSDAIPP
I have a drive letter mounted to a webdav url (using basic authentication), I pass the credentials when executing the net use command. This is all working fine, when looking at my tcpdump i can see how every request is done by…

SjefVL
- 1
- 2
0
votes
1 answer
Batch file change a drive letter string in a log file
trying to replace drive designation inside Idrive log files using a batch. Amateur programmer trying to understand batch files for years but still don't get advanced techniques. I suspect the '\' backslash needs to be escaped but nothing I try…

wschloss
- 15
- 1
- 5