Batch file 如何在单个cmd调用中表示以下批处理步骤?
假设我在批处理文件中有如下步骤Batch file 如何在单个cmd调用中表示以下批处理步骤?,batch-file,dos,Batch File,Dos,假设我在批处理文件中有如下步骤 set dir=%CD% cd ..\notes dir /b *.tex > %dir%\log.txt cd %dir% 如何在单个cmd调用中表达这些步骤 我试图打电话如下 cmd /c set dir=%CD% cd ..\notes dir /b *.tex > %dir%\log.txt cd %dir% 但它不起作用。这应该起作用 cmd /c "pushd ..\notes & dir /b *.tex > %cd%\
set dir=%CD%
cd ..\notes
dir /b *.tex > %dir%\log.txt
cd %dir%
如何在单个cmd
调用中表达这些步骤
我试图打电话如下
cmd /c set dir=%CD% cd ..\notes dir /b *.tex > %dir%\log.txt cd %dir%
但它不起作用。这应该起作用
cmd /c "pushd ..\notes & dir /b *.tex > %cd%\log.txt & popd"
从未使用过pushd和popd(阅读一次)。做得好:)