How to deal with "CMD does not support UNC paths as current directories"

You need to use the "pushd" command instead of "cd" to change the current directory to a UNC path (e.g.: >pushd \\servername\sharename).

"the pushd command creates a temporary drive letter that points to the network resource, and then changes the current drive and folder to the new drive letter. Temporary drive letters are allocated starting from Z and then backward through the alphabet, using the first unused drive letter found."

Use "popd" when you're finished (e.g.: >popd) to cleanup the temporary mapped drive.

For more info see How To Use the PUSHD Command to Access a UNC Path at a Command Prompt in Windows 2000 (http://support.microsoft.com/kb/317379)

OR

Use powershell - which has complete support for unc paths.

No comments:

Post a Comment