6
2
I have a remote directory that is shared and mounted to my localhost. I know the remote directory is mounted and shared correctly as I can read, write, execute the file during a normal mouse and click event.
Although, I do need to script something and would like to do this using the Windows cmd executable.
For example, I want to cd
/ change directory into the the remote directory and rename the file.
How do I do so in a sample Windows script?
So far, the command line below isn't working for me. I might not be passing this properly in the first place.
C:\>cd \\myremotehost\MY_DIR
Error:
`\myremotehost\MY_DIR'
CMD does not support UNC paths as current directories
I want to script this and rename myfile
to mynewnamefile
.
The error message CMD gives you is very straightforward: "CMD does not support UNC paths". You need to map a drive to it so that CMD doesn't have to know that it's a UNC path. – jcrawfordor – 2011-06-10T02:18:55.690
Does it have to be with the UNC (\myremotehost\MY_DIR), or do you care if it is mapped (given a drive letter)? Do you want a workaround? – KCotreau – 2011-06-10T02:29:35.927
it doesn't matter for the directory name. I was able to mount using a letter. as long as i can make my way to the files. – jdamae – 2011-06-10T02:37:27.063
Duplicates this ServerFault question.
– JdeBP – 2011-06-10T10:28:54.807