Accessing Mapped Drives from the Command Line

G

Guest

Hello there, does anyone know how I can access a UNC locally Mapped drive
(e.g. mappying \\server\vol1 to z:\) from the command line on a Vista 64 bit
machine? Running the command prompt with admin privileges still does not
allow me to do so... Nor does things like \\.\ or \\??\ etc. Thanks!
 
K

Kerry Brown

Have you tried the NET USE command?

NET USE z: \\server\share

If you have what errors do you get.
 
G

Guest

The problem is not about the mapping itself, I was able to map the Z: drive
just fine, however, when I want to reference it from a command prompt e.g.
when I go to the command prompt and say >z:\RunProgram.exe or >z: or etc. it
just complains that z: does not exist...
 
L

Lang Murphy

So when you run "net use" without any switches does it show you your mapped
drives or not?

Lang
 
G

Guest

(Answering my own question at the bottom)
The drive is mapped and perfectly fine and browsable from Windows Explorer
(access, copy, etc. all fine from Explorer) but NOT from the command line. I
discovered A solution... You basically set the properties of the command
line window to "Start in" the mapped drive (e.g. z:\) and you launch the
command line NOT using "Run as Admin". If you use Run as Admin you will be
started in the system32 folder regardless... Howver, the problem is that you
will be prompted for Admin concent every time you launch something from the
command line.
E.g.
1) Map Z:\ to \\server\vol1
2) create a shortcut of the command line on the desktop
3) right click on the shortcut of the command line and set the "Start in" to
"Z:\"
4) double click on the shortcut (do NOT right click and set the "Run as
Admin")
5) Every time you need Admin concent, you will be prompted (defeats the idea
of using command line for automation!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top