标题: 请教各位大虾!管道命令
[打印本页]
作者: zhiguo7
时间: 2004-11-3 00:00
标题: 请教各位大虾!管道命令
在批处理中,如何返回批处理命令所在的当前目录,也就是说,如何把当前目录赋值给一个变量??求救!!!!谢谢
作者: Climbing
时间: 2004-11-4 00:00
:: 用下边的三个命令保存当前目录到curdir变量中
cd | lmod /L1 set curdir=[] > temp.bat
call temp.bat
del temp.bat
:: 进行你的其它操作
...
:: 返回保存的当前目录
cd %curdir%
作者: 死性不改
时间: 2004-11-4 00:00
@echo off
for /f %%i in ('CD') do set cdir=%%i