Cannot map network drives using 'net use' while elevated as an administrator
It's because of the space in your path argument ("my documents").
Wrap the path in quotes so Windows knows it's a single argument:
net use f: "\\joey-laptop\user\joey\my documents\folder\"
Related videos on Youtube
Joey Miller
Updated on September 18, 2022Comments
-
Joey Miller over 1 year
So, this problem stems from not being able to save anything on my network drives. I tried using
takeown
on everything in the network drive as the user Joey (which is an administrator on my computer because it's the only user account and it says so in the control panel, right?), so I decided to run cmd.exe as an administrator. Now it can't find the network drive tocd
to, so I looked that up and found that it has to be mapped as an administrator.net use f: \\joey-laptop\users\joey\my documents\folder
is the command I'm using, and it gives me this output:Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Joey>cd /DF:\ The system cannot find the path specified. C:\Users\Joey>net use f: \\joey-laptop\user\joey\my documents\folder\ The syntax of this command is: NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]] [/USER:[domainname\]username] [/USER:[dotted domain name\]username] [/USER:[username@dotted domain name] [/SMARTCARD] [/SAVECRED] [[/DELETE] | [/PERSISTENT:{YES | NO}]] NET USE {devicename | *} [password | *] /HOME NET USE [/PERSISTENT:{YES | NO}] C:\Users\Joey>
I don't really know why it's giving me the help info, but it is, so I'm assuming it would be doing this regardless of the folder I was trying to map to. What am I doing wrong?
EDIT: F:\ is already mapped, but that was done as Joey. I read that
net use
lets you overwrite existing maps.EDIT 2: Access denied when writing files to network drive is somewhat of a follow-up question to this.
-
Paul over 10 yearsCan you
ping joey-laptop
from the machine you are runningnet use
from? And does it definitely have a share calleduser
? -
Joey Miller over 10 yearsThanks @Paul. Ping was 0ms because
joey-laptop
is my machine. I made a typo in the command up there, the share is actually supposed to be calledusers
, but it still gives me the same error. -
Paul over 10 yearsOh, you are trying to map a drive to your own machine via the network? There are other ways to do this, but anyway, can you try this via explorer, it might give a clue as to why it isn't working. Press <kbd>alt</kbd> to show the menu, then
Tools / Map Network Drive
-
Joey Miller over 10 yearsYes, except I need to create the network drive as an administrator so I can modify its permissions. It all kinda comes back to my network drives somehow not letting me do anything to them.
-
Joey Miller over 10 years@Paul thank you, I tried that but I don't believe it worked.
-