联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off for /f "delims=" %%i in ('dir /a-d /b *.rar') do call :copy_ "%%i" pause goto :eof :copy_ set var=%1 echo md %var:~1,10% 2>nul echo copy %1 %var:~1,10% goto :eof
call 调用的时候,最让人动心的功能是可以带形参,格式为 call 标签名 参数1 参数2 ……,这些参数你可以任意赋值(不管它在被调用的标签段中是否有用),一般是以空格或逗号作为两个参数之间的分隔符
Set WshShell = WScript.CreateObject("WScript.Shell") set fso=createobject("scripting.filesystemobject") on error resume next set folder=fso.getfolder(WshShell.CurrentDirectory) set files=folder.files for each file in files if lcase(fso.GetExtensionName(file)) ="rar" then rq=File.DateLastModified a=instrrev(rq," ") if fso.folderexists(left(rq,a-4)) then fso.movefile file, left(rq,a-4) & "\" else fso.createfolder (left(rq,a-4)) fso.movefile file, left(rq,a-4) & "\" end if else end if next msgbox "已经将所有RAR文件保存以创建日期命名的文件夹中。",48+4096,"操作完成"