How to express the following batch steps in a single cmd invocation?
Assume I have steps in a batch file as follows.
set 开发者_StackOverflowdir=%CD%
cd ..\notes
dir /b *.tex > %dir%\log.txt
cd %dir%
How to express these steps in a single cmd
call?
I attempted to call as follows
cmd /c set dir=%CD% cd ..\notes dir /b *.tex > %dir%\log.txt cd %dir%
but it did not work.
This should work
cmd /c "pushd ..\notes & dir /b *.tex > %cd%\log.txt & popd"
精彩评论