What can cause PUSHD?

I have a big script that is completely dependent on PUSHD. However, when I type pushd \\server1\dir1 , I get:

 C:\Documents and Settings\userNameHere>pushd \\server1\dir1 ' ' CMD does not support UNC paths as current directories. 

OK, I know that CMD does not support UNC paths. That is why I use PUSHD. When I search for this, I find many posts that say: "When you come across this UNC path message, you should use PUSHD!" Well shit, I come across this message and use PUSHD.

I tried using CMD /E:ON because PUSHD is only active when command extensions are enabled. The same result.

I looked to see if I had any letters from the drive (since PUSHD starts with Z: and goes back to find the drive letter). Nope.

I tried running my cmd in c: \ dir ( cd c:\ , then pushd \\server1\dir1 ).

I confirmed that there is a disk, and I have access to it through Windows Explorer.

And now I have no ideas.

Link Pushd: Link

+6
dos batch-file
source share
3 answers

OK, the answer to this question, as far as I can tell, is that if you are on Y: in your mapped drives, pushd will not work. So you need to do net use y: /delete (or another drive letter), and then map your drive using pushd . I had all drive letters, with the exception of Z and A. Perhaps Z is reserved? I do not know.

My mistake was to check if Z: is available (it was not displayed). Obviously, if you drew everything before and including Y: then it will not display Z :. I do not know why.

+5
source share

You need to make sure that command extensions are enabled.

Registry keys:

 HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions and/or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions 

Set either 0x1 (Enabled) or 0x0 (Disabled). The user parameter takes precedence over the machine settings.

Also make sure that drive letters are available for the pushd command. If all drive letters are already mapped and used, the pushd command will fail as you described in detail.

+1
source share

I wouldn’t match the drive with the letter, as usual, would do the trick up to "pushd" ... as in your example

  net use E: \\\\ server1 \\ dir1
 pushd E: \
 ....
 popd
0
source share

All Articles