Accessing a remote mounted directory from Windows CMD.EXE

You need to mount the network location as a network drive before you can use it from the command prompt. Like so:

net use x: \\myremotehost\MY_DIR
x:

Afterwards you should be able to perform whatever operations you want, using the X:\ in place of \myremotehost\MY_DIR. When you are done, you can disconnect the drive with

net use x: /delete

Your share is probably mounted as a drive letter. You would most likely want to do something like this:

ren X:\my file myfile

To script it, you could simply put the command into a .cmd file.


Based on your comment, then what you want to do is this batch file:

x:

cd\directory

ren filename newfilename

The first command seems to be what you are missing.

Another workaround if you want to use the UNC is this:

xcopy \\server\directory\filename \\server\directory\newfilename

del \\server\directory\filename

The effect is the same.