Jump to content

Welcome to Geeks to Go - Register now for FREE
Geeks To Go is a helpful hub, where thousands of friendly volunteers serve up answers and support. Get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message and all ads will be removed once you have signed in.
Create an Account Login to Account

Dismounting / Mounting network drive via command line


  • Please log in to reply

#1
diggeryo

diggeryo

    Member

  • Member
  • PipPipPip
  • 339 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

Advertisement


#2
dsenette

dsenette

    Je suis Napoléon!

  • Administrator
  • 25,766 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

  • Member
  • PipPipPip
  • 339 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!

  • Administrator
  • 25,766 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

  • Member
  • PipPipPip
  • 339 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!

  • Administrator
  • 25,766 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

  • Member
  • PipPipPip
  • 339 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

Advertisement




Similar Topics: Dismounting / Mounting network drive via command line     x


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

featured