推送的“网络”路径返回CMD不支持UNC路径作为当前目录 [英] pushd \\network\path returns CMD does not support UNC paths as current directories

查看:86
本文介绍了推送的“网络”路径返回CMD不支持UNC路径作为当前目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用批处理文件从网络访问某些文件。

I was using a batch file to access some files from network.

我正在使用

pushd \\Network\path 

导航到网络目录以启动一些脚本

to navigate to the networked directory to initiate some scripts

我的bat文件运行良好,直到今天早上我看到返回CMD的cmd不支持将UNC路径作为当前目录使用。

My bat file was working perfectly fine till this morning I saw "cmd returning CMD does not support UNC paths as current directories".

使用cd而不是推送到网络目录时,我已经看到此错误消息,但我可以弄清楚为什么以前的bat文件会出错。

I have seen this error message when using cd instead of pushd to navigate to a network directory but I can figure out why I am getting error for a previously working bat file.

而且我确实确保网络位置在线并且可以通过其他方式访问。

And I did make sure that network location was online and accessible other way round.

推荐答案

推入/?


如果启用了命令扩展名,则PUSHD除了正常的驱动器号和路径,该命令还接受网络
路径。如果指定了网络
路径,PUSHD将创建一个临时驱动器盘符,
指向指定的网络资源,然后更改当前的
驱动器和目录。

If command extensions are enabled the PUSHD command accepts network paths in addition to the normal drive letter and path. If a network path is specified, PUSHD will create a temporary drive letter that points to the specified network resource and then change the current drive and directory.

净使用中c>是否被执行?

Do any mapped drives show up in net use after pushd is executed?

如果没有出现某种网络授权错误,请确保启用了命令扩展名(我不确定为什么他们不这样做)

If you're not getting some kind of network authorization error, make sure command extensions are enabled (I'm not sure why they wouldn't be.)

cmd / x 将启用当前CMD会话的扩展。在执行批处理脚本之前,请尝试执行该操作。

cmd /x will enable extensions for the current CMD session. Try that prior to executing your batch script.

主开关位于 HKEY_CURRENT_USER\Software\Microsoft\Command Processor code>。
EnableExtensions 应该为(DWORD)1

The "main switch" is in HKEY_CURRENT_USER\Software\Microsoft\Command Processor. EnableExtensions should be (DWORD) 1

这篇关于推送的“网络”路径返回CMD不支持UNC路径作为当前目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆