【发布时间】:2021-09-09 16:38:39
【问题描述】:
Is it possible to Redirect cd command output into new file 这里是C:\ Partition中的路径列表
C:\Inetpub\vhosts\apnat\httpdocs
C:\Inetpub\vhosts\interline\httpdocs
C:\Inetpub\vhosts\dentin\httpdocs
C:\Inetpub\vhosts\archm\httpdocs
C:\Inetpub\vhosts\archacom\httpdocs
C:\Inetpub\vhosts\arowmom\httpdocs
C:\Inetpub\vhosts\myrin\httpdocs
...
有些路径可以打开且没有错误,有些则没有拒绝访问错误我正在尝试将所有可打开的路径保存到新文件中并尝试使用此命令
for /f %x in (paths.txt) do cd %x | echo %cd%>>C:\users\vb3\results.txt
for /f %x in (paths.txt) do (cd %x & echo %cd%>>C:\users\vb3\results.txt)
我正在尝试使用这些命令,但 输出文件为空 或填充了同一行
C:\Windows\SysWOW64\inetsrv
C:\Windows\SysWOW64\inetsrv
C:\Windows\SysWOW64\inetsrv
C:\Windows\SysWOW64\inetsrv
...
...
【问题讨论】:
标签: batch-file cmd command-prompt