Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Dismounting / Mounting network drive via command line


  • Please log in to reply

#1
diggeryo

diggeryo

    Member

  • Member
  • PipPipPip
  • 354 posts
On the computer in question, I am using Windows XP Home SP3 with all the latest updates installed. Is there any way to mount and dismount a network drive using the command line?

thanks,
mike.
  • 0

Advertisements


#2
dsenette

dsenette

    Je suis Napoléon!

  • Community Leader
  • 26,047 posts
  • MVP
yes

you can either use the net use command

to map a drive:
net use <Drive Letter>: \\<computername>\<sharename>\
*adding the /P switch will make it persistent, I.E. it will reconnect next time you start your computer

to unmap a drive:
net use <Drive Letter>: /Delete

or you could use a VBScript (i can supply an example of one if you like)
  • 0

#3
diggeryo

diggeryo

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 354 posts
Hi dsenette,

Thanks for the reply.

I got the unmap command to work. The map command, however, is giving me the following error:

"System error 53 has occurred.
The network path was not found."

However, when I attempt to remap the drive through Windows, it will map correctly.

I should point out that, though I mentioned I will be using this on a computer with XP Home, I am currently testing it out on my work computer, which is XP Professional. Could that be causing the error in question?

By the way, no need, I believe, to supply an example of the VBScript. Thanks for the offer, though.

Mike.
  • 0

#4
dsenette

dsenette

    Je suis Napoléon!

  • Community Leader
  • 26,047 posts
  • MVP
it should work in home or pro

what exactly are you typing to map the drive?

it should look like:
net use e: \\financial\letters
  • 0

#5
diggeryo

diggeryo

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 354 posts
I figured out the problem. The name I was trying to map had a space in it. I tried the commands you supplied on a network drive without a space in the name, and it worked fine.

My home computer, however, DOES have a space in the name I believe. How would I map such a drive?

This is the command I was using here that did NOT work: net use p: \\diane comp\diane

I then tried all of the following, but none worked:

net use p: "\\diane comp\diane"
"net use p: \\diane comp\diane"
net use p: \\"diane comp"\diane

Any suggestions?
  • 0

#6
dsenette

dsenette

    Je suis Napoléon!

  • Community Leader
  • 26,047 posts
  • MVP
net use p: "\\diane comp\diane"
that one should work

in the command prompt can you ping that computer by name?

type
ping "diane comp"
does that work?
  • 0

#7
diggeryo

diggeryo

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 354 posts
The ping request came back as follows: "Ping request could not find host diane comp. Please check the name and try again."

Which is wierd, because I am able to map it in Windows. And can access the drive through a command prompt once it is mapped in Windows.

However, we might be getting ahead of ourselves here. As I said, I was just testing the commands you gave me on "diane comp." I will really be using them on my home computer, though, so it doesn't matter that it won't work on "diane comp." If I run into the same problem on my home computer, I just might be replying to this thread again, though.

Thanks for the help, and I hope you won't be hearing from me again. ;-)

mike.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP