程序也很简单,就是遍历一下本地目录,然后产生一堆ftp命令。
复制代码 代码如下:
function matchDemo(strFolderName)
{
var s;
var re = /200\d{5}/ig;
s = strFolderName.match(re);
return(s);
}
function init()
{
strScript ="open 192.168.1.32 \n";
strScript+="user sybase 111111 \n";
strScript+="bin\n";
strScript+="prompt\n";
strScript+="cd /hisdata/olddata \n";
dicWhiteList = new ActiveXObject("Scripting.Dictionary");
dicWhiteList.add ("20051205_pihou", "");
dicWhiteList.add ("20051206_pihou", "");
dicWhiteList.add ("20060701_pihou", "");
}
function EnumSubFolder(oSubFolder)
{
var eFolders=new Enumerator(oSubFolder.SubFolders);
var s="";
if(eFolders.atEnd())
{
return s;
}
else
{
for (; !eFolders.atEnd(); eFolders.moveNext())
{
s+="lcd \"";
s+=eFolders.item();
s+="\"\n";
s+="mput *.*\n";
}
return s;
}
}
function checkList(strToBeChecked)
{
return !dicWhiteList.Exists(strToBeChecked);
}
var strScript,dicWhitList;
var sFolderPath="e:\\";
var oFs=new ActiveXObject("Scripting.FileSystemObject");
init();
if (oFs.FolderExists(sFolderPath))
{
//WScript.Echo("valid folder");
var oFolders=oFs.GetFolder(sFolderPath);
var eFolders=new Enumerator(oFolders.SubFolders);
if(eFolders.atEnd())
{
strScript += "mkdir \"";
strScript += oFs.GetBaseName(sFolderPath);
strScript += "\"\n";
}
else
{
for (; !eFolders.atEnd(); eFolders.moveNext())
{
strTargetFolderName=matchDemo(eFolders.item()+"");
if(strTargetFolderName==null || checkList(oFs.GetBaseName(eFolders.item())))
continue;
strTmpFolderName="\""+oFs.GetBaseName(eFolders.item())+"\"";
strScript += "mkdir "
strScript += strTargetFolderName;
strScript += "\n";
strScript += "cd ";
strScript += strTargetFolderName;
strScript += "\n";
strScript += EnumSubFolder(eFolders.item());
strScript += "lcd "
strScript += eFolders.item();
strScript += "\n";
strScript += "mput *.*\n";
strScript += "cd \nlcd \n";
}
}
strScript+="bye\n";
WScript.Echo(strScript);
}
else
{
WScript.Echo("Bad Folder Name");
}
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 【雨果唱片】中国管弦乐《鹿回头》WAV
- APM亚流新世代《一起冒险》[FLAC/分轨][106.77MB]
- 崔健《飞狗》律冻文化[WAV+CUE][1.1G]
- 罗志祥《舞状元 (Explicit)》[320K/MP3][66.77MB]
- 尤雅.1997-幽雅精粹2CD【南方】【WAV+CUE】
- 张惠妹.2007-STAR(引进版)【EMI百代】【WAV+CUE】
- 群星.2008-LOVE情歌集VOL.8【正东】【WAV+CUE】
- 罗志祥《舞状元 (Explicit)》[FLAC/分轨][360.76MB]
- Tank《我不伟大,至少我能改变我。》[320K/MP3][160.41MB]
- Tank《我不伟大,至少我能改变我。》[FLAC/分轨][236.89MB]
- CD圣经推荐-夏韶声《谙2》SACD-ISO
- 钟镇涛-《百分百钟镇涛》首批限量版SACD-ISO
- 群星《继续微笑致敬许冠杰》[低速原抓WAV+CUE]
- 潘秀琼.2003-国语难忘金曲珍藏集【皇星全音】【WAV+CUE】
- 林东松.1997-2039玫瑰事件【宝丽金】【WAV+CUE】