本帖最后由 bailong360 于 2016-2-28 13:18 编辑
- //&cls&@dir /a-d /b *.jpg|cscript -nologo -e:jscript "%~f0"&pause&exit
- var FSO = new ActiveXObject('Scripting.FileSystemObject');
- var file = FSO.OpenTextFile('list.txt', 2, true);
- var i = 0;
- while (!WSH.StdIn.AtEndOfStream) {
- i += 1;
- var oldfile = FSO.GetFile(WSH.StdIn.ReadLine());
- var s = '000' + i;
- var newname = '2016-' + s.substring(s.length - 4) + 'SOHU.jpg';
- file.Write(oldfile.Name + ',' + newname + ',' + oldfile.DateCreated + ',' + oldfile.Size + '\n');
- oldfile.Name = newname;
- }
- file.Close();
复制代码 js练手
保存为.bat文件执行 |