Sometimes you may need to access the files from shared location from command prompt. For this you can't change to the Shared location directly by "cd".
Here is the solution for this.
Use the command "net use <drive letter to map> <Shared Location path>
Ex: net use Z: \\ServerNameOrIP\SharedFolderName
In above example Z: is the Drive Letter you want to map, & map the drive with location "\\ServerNameOrIP\SharedFolderName". Once you execute the command path automatically changed to the above shared folder.
Note: Don't give \ (Back slash) at the end of the path. otherwise it gives the error "The network path was not found"
Once you execute the above command, there is a drive shows mapped in My Computer along with other mapped drives.
The above Drive mapping is permanent. If you want to unmap, from command prompt use the below command
net use <drive letter to unmap> /delete
ex usage for the Z: drive
net use Z: /delete
Note2: If the drive letter is already used, it throws the error
"The local device name is already in use"
Then try with new Drive name which is not used.
To temporarily map the drive use the below commands
pushd <Shared folder path>
ex: pushd \\Servername\sharedfolder
PUSHD \\SERVER\SHARE will silently map a drive. It starts at Z: and moves backwards until it finds an available letter.
after your use execute the below command or you can directly exit from command prompt
popd
Here is the solution for this.
Use the command "net use <drive letter to map> <Shared Location path>
Ex: net use Z: \\ServerNameOrIP\SharedFolderName
In above example Z: is the Drive Letter you want to map, & map the drive with location "\\ServerNameOrIP\SharedFolderName". Once you execute the command path automatically changed to the above shared folder.
Note: Don't give \ (Back slash) at the end of the path. otherwise it gives the error "The network path was not found"
Once you execute the above command, there is a drive shows mapped in My Computer along with other mapped drives.
The above Drive mapping is permanent. If you want to unmap, from command prompt use the below command
net use <drive letter to unmap> /delete
ex usage for the Z: drive
net use Z: /delete
Note2: If the drive letter is already used, it throws the error
"The local device name is already in use"
Then try with new Drive name which is not used.
To temporarily map the drive use the below commands
pushd <Shared folder path>
ex: pushd \\Servername\sharedfolder
PUSHD \\SERVER\SHARE will silently map a drive. It starts at Z: and moves backwards until it finds an available letter.
after your use execute the below command or you can directly exit from command prompt
popd
Thanks ,, very usefull , working tip
ReplyDeletethanks a lot.u have saved me
ReplyDelete