2010-03-09 2 views
0

내가 윈도우 7 DOS 셸 내에서 비행에 bash는 명령 파일을 만들려고 해요 : 나는^(캐럿 두 번째 에코 명령 접두어 생각배치 파일에서 이스케이프 '에코'

:: inside the .BAT file .. 
:: check we are in the right directory 
echo pwd > command.txt 
:: get the shell to echo its environment variables 
:: !!!! How do I get around this ... ? 
echo echo $PWD 

)는 작동하지만 no. 해결 방안은 무엇인가?

답변

3

난 그냥

을 시도 @echo 에코 % TMP %의 반환

에코 C : \ 사용자 스파이크 \의 AppData \ 로컬 \ 온도를 \

나는 문제가 '년후 생각 $ PWD만큼 에코. %%는 $에 대한 DOS입니다. 이것은 Windows XP에서 나를 위해 작동

2

,

@echo off 
:: inside the .BAT file .. 
:: check we are in the right directory 
echo pwd > command.txt 
:: get the shell to echo its environment variables 
:: !!!! How do I get around this ... ? 
echo echo ^$PWD >>command.txt 

출력

C:\test>test.bat 

C:\test>more command.txt 
pwd 
echo $PWD