tags:

views:

138

answers:

2

I've got a great big script that is entirely reliant on PUSHD. However suddenly when I type pushd \\server1\dir1 I'm getting:

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

OK, I'm aware that CMD doesn't support UNC paths. That's why I'm using PUSHD. When I search for this I find lots of posts that say "When you encounter this message about UNC paths, you should use PUSHD!". Well crap, I'm encountering that message and using PUSHD.

I tried using CMD /E:ON because PUSHD is only active when Command Extensions are enabled, apparently. Same result.

I looked to see if somehow I was out of drive letters (since PUSHD starts at Z: and goes backward to find a drive letter). Nope.

I tried starting my cmd at the c:\ dir (cd c:\ then pushd \\server1\dir1).

I confirmed that the drive is there and I have access to it, via Windows Explorer.

And now I'm out of ideas.

Pushd reference: Link

A: 

Would not mapping the drive to the letter as usual would do the trick prior to 'pushd'...as in your example

net use E: \\\\server1\\dir1
pushd E:\
....
popd
tommieb75
pushd isn't supposed to be dependent on net use. The point of pushd is to 'just figure it out': map a drive and change the pwd over to it.
jcollum
A: 

OK the answer to this, as far as I can tell, is that if you're at Y: in your mapped drives then pushd won't work. So you need to do net use y: /delete (or some other drive letter) then map your drive using pushd. I had all drive letters mapped, except for Z and A. Maybe Z is reserved? I dunno.

My mistake was checking to see if Z: was available (it wasn't mapped). Apparently if you've mapped everything up to and including Y: then it won't map Z:. No idea why.

jcollum