什么会导致PUSHD失败? [英] what could cause PUSHD to fail?
问题描述
我有一个很棒的大脚本,完全依赖于PUSHD.但是当我键入pushd \\server1\dir1
时突然得到:
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.
好的,我知道CMD不支持UNC路径.这就是为什么我使用PUSHD.当我搜索此消息时,我发现很多帖子都说当您遇到有关UNC路径的消息时,应使用PUSHD!".好吧,我正在使用PUSHD遇到该消息和.
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.
我尝试使用CMD /E:ON
是因为PUSHD仅在启用命令扩展时才处于活动状态.结果相同.
I tried using CMD /E:ON
because PUSHD is only active when Command Extensions are enabled, apparently. Same result.
我查看是否以某种方式无法使用驱动器号(因为PUSHD从Z:开始并向后查找驱动器号).没有.
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.
我尝试在c:\ dir(先按cd c:\
然后按pushd \\server1\dir1
)启动cmd.
I tried starting my cmd at the c:\ dir (cd c:\
then pushd \\server1\dir1
).
我确认驱动器在那里,并且可以通过Windows资源管理器访问它.
I confirmed that the drive is there and I have access to it, via Windows Explorer.
现在我没主意了.
推送参考:链接
推荐答案
好的,据我所知,答案是,如果您位于Y:在映射的驱动器中,则无法进行推送.因此,您需要执行net use y: /delete
(或其他驱动器号),然后使用pushd
映射驱动器.我已映射所有驱动器号,除了Z和A.也许Z是保留的?我不知道.
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.
我的错误是检查Z:是否可用(未映射).显然,如果您已将所有内容映射到Y :,包括Y :,则不会映射Z :.不知道为什么.
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.
这篇关于什么会导致PUSHD失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!