# Connecting to a server drive using UNC



## cgjoker (Aug 13, 2003)

Hi there.

I have a batch file that exists on my PC. I would like to connect to a server drive, (lets say the server name is Server1), so that I can cd in my batch file to a specific directory.

Here is what ive tried, but with no luck. Im using Windows 2000.


Net Use X:\\Server1\folder1

chdir X:\folder2

del report.htm

Here is the error I receive:

System error 67 has occured.

The network name cannot be found.

Any help would be greatly appreciated.


----------



## coderitr (Oct 12, 2003)

It's tough to see in the font here but is there a space between "net use x:" and "\\Server1\Folder1" -- if not there must be. If the syntax is correct, make sure that you have permissions on the network to connect to this share.

You should also check to see if the drive is already mapped first and if it is delete the current mapping so you can direct it to the share you want


```
net use x: /d /y
```
In Windows 2000 the cd command supports the /d switch so you can change to the directory on the drive and change to that drive at the same time:


```
cd /d x:\folder2
```


----------



## gweinhold (Jul 13, 2004)

Why not just complete the action in one line like so:

```
del \\server1\folder1\report.htm
```
I can understand you'd not want to retype all the directory path in if it's more than a few files though.

coderitr is correct, your "net use" syntax is off. You need a space between the drive letter and the UNC path you'd like to map to.


```
Net Use X: \\Server1\folder1
```


----------

