Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 Windows 批处理文件,它输出目录路径,例如:
@echo c:\windows
我想将此字符串“c:\windows”传递给 PUSHD 命令。我试过这个:
path.bat | PUSHD
但它出错了“进程试图写入不存在的管道。”。
请帮忙。
已解决的命令提示符日志如下所示:
c:\>path.bat | PUSHD c:\Windows>
基本思路(需要做适当的调整):
for /f %i in ('path.bat') do pushd %i