%1和 %%1有什么关系和区别
批处理的%1错在哪里?请指教!!
1,
@echo off
dir %1 c:\d4.txt
type %1
copy %1 e:\
dir 可以.但type 找不到文件
2,
@echo off
set c:\d4.txt=%1
dir %1
type %1
copy %1 e:\
3,
@echo off
set 1=(or ==) c:\d4.txt
dir %1%
type %1%
copy %1% e:\
4,
@echo off
if exist %1 c:\d4.txt type %1
没反映,或语法不正确
哪里有问题? 应该怎么写能把形参(%1)和实参(c:\d4.txt,要求只写一次,不该重复劳动)同时放在批文件中,并且只要在命令行中输入批文件名即可执行