@echo off
rem MYCOPY.BAT copies any number of files
rem to a directory.
rem The command uses the following syntax:
rem mycopy dir file1 file2 ... set todir=%1
:getfile
shift
if "%1"=="" goto end
copy %1 %todir%
goto getfile
:end
set todir=
echo All done
[ Last edited by Hanyeguxing on 2010-3-9 at 19:45 ]作者: gool123456 时间: 2010-3-9 23:33 很感谢二楼的回答!
我想问的是:那%1和%todir%分别指的是什么,这里的%1有什么用?作者: Hanyeguxing 时间: 2010-3-9 23:42
Quote:
Originally posted by gool123456 at 2010-3-9 23:33:
很感谢二楼的回答!
我想问的是:那%1和%todir%分别指的是什么,这里的%1有什么用?
@echo off
rem MYCOPY.BAT copies any number of files
rem to a directory.
rem The command uses the following syntax:
rem mycopy dir file1 file2 ...
set todir=%1
:getfile
shift
if "%1"=="" goto end
copy %1 %todir%
goto getfile
:end
set todir=
echo All done
[ Last edited by Hanyeguxing on 2010-3-9 at 23:48 ]作者: gool123456 时间: 2010-3-9 23:47 Hanyeguxing兄这么一说,我明白这里的shift在这个批处理的作用了!谢谢。