16

I can list all files in a folder with: dir \\aenw08v401\FOLDER\I001\*

However, when I execute cd \\aenw08v401\FOLDER\I001, the current working directory won't change at all.

This is what I see when I execute net view \\aenw08v401:

Shared resources at \\aenw08v401
Share name  Type  Used as  Comment

-----------------------------------
FOLDER    Disk
The command completed successfully.

Is there a switch I am missing, or do I need to use a different command?

21

Issue: The Windows command prompt cmd does not support UNC paths as current directories.

C:\Users\PrimaryUser>cd \\myServer\myShare
CMD does not support UNC paths as current directories.

Solution: Use pushd

C:\Users\PrimaryUser>pushd \\myServer\myShare

Z:\>dir
 Volume in drive Z is MYDRIVE
 Volume Serial Number is 1234-5678

 Directory of Z:\

12/16/2015  11:18 AM    <DIR>          .
12/16/2015  11:18 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  120,609,575,936 bytes free

Z:\>popd

C:\Users\PrimaryUser>

Alternate Solution: Map the UNC path to an unused drive letter.

C:\Users\PrimaryUser>net use Y: \\myServer\myShare 
The command completed successfully.

C:\Users\PrimaryUser>Y:

Y:\>dir
 Volume in drive Y is MYDRIVE
 Volume Serial Number is 1234-5678

 Directory of Y:\

12/16/2015  11:18 AM    <DIR>          .
12/16/2015  11:18 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  120,609,575,936 bytes free

Y:\>C:

C:\Users\PrimaryUser>net use /delete Y:
Y: was deleted successfully.
  • 2
    The pushd solution worked perfectly for me, though in the end psexec worked out better for me – tomdemuyt Dec 17 '15 at 12:36
  • Or use PowerShell where cd \\Server\path just works. – Franklin Yu May 10 '18 at 20:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.