? 原文如下:http://www.ljnid.cn/?id=261
?? 寫了個(gè)JS腳本,可以刪除指定文件夾下面的所有.SVN文件夾
?? 在windows server 2003下測(cè)試通過,不保證XP可以運(yùn)行
?? 使用方法:把下面的代碼保存為xxx.js
? 在控制臺(tái)用:cscript.exe xxx.js X:\xxx\xx
? 其中X:\xxx\xx是你指定的路徑?
?
js代碼:
if(WScript.Arguments.length==0)???
WScript.quit();???
??
var?fso?=?new?ActiveXObject("Scripting.FileSystemObject");???
var?fc,folder,folderList=[];???
var?rootFolder?=?fso.getFolder(WScript.Arguments(0));???
??
folderList.push(rootFolder);???
while(folderList.length>0){???
folder?=?folderList.pop();???
fc?=?new?Enumerator(folder.SubFolders);???
while(!fc.atEnd())???
{???
if(fc.item().name?=='.svn')???
fso.deleteFolder(fc.item().path,true);???
else??
folderList.push(fc.item());???
??
fc.moveNext();???
}???
}??
WScript.quit();???
??
var?fso?=?new?ActiveXObject("Scripting.FileSystemObject");???
var?fc,folder,folderList=[];???
var?rootFolder?=?fso.getFolder(WScript.Arguments(0));???
??
folderList.push(rootFolder);???
while(folderList.length>0){???
folder?=?folderList.pop();???
fc?=?new?Enumerator(folder.SubFolders);???
while(!fc.atEnd())???
{???
if(fc.item().name?=='.svn')???
fso.deleteFolder(fc.item().path,true);???
else??
folderList.push(fc.item());???
??
fc.moveNext();???
}???
}??