0

I am trying to map a drive with an elevated batch file but any attempt to use the Net Use command fails. The error is always: "The system cannot find the drive specified."

I am using the following code: Net Use w: "\Server\Folder"

It works fine with an elevated command prompt or with a non-elevated batch file.

I also tried simply: Net Use Yet with an elevated batch file even that fails with the same error message.

1 Answers1

0
net use DrvLetter: \\server\sharename[\foldername]

so

net use m: \\serenity\C$

Note UNC paths start \\

or for any computer this will work to the admin share called C$. $ means it's a hidden share. Every drive has one (ie D$, E$, ..., Z$) + there is Admin$ (C:\windows), IPC$, and Printer$ (your printer driver folder).

net use m: \\%computername%\C$
Serenity
  • 311
  • 2
  • 3
  • Thanks for your suggestion. However, using hidden shares doesn't seem to have solved the problem. I am still getting the same message: "The system cannot find the drive specified." – Trevor Patton Apr 13 '15 at 15:21