拿去花- @if (0)==(0) echo off
- set "srcDir=D:\test"
- set "dstDir=E:\Temp"
- md "%dstDir%" 2>nul
- dir /b /a-d /s "%srcDir%\*.ppt" | cscript //nologo //e:jscript "%~f0" "%dstDir%"
- pause & exit
- @end
-
- var dstDir = WSH.Arguments(0) + '\\';
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- var objApp = new ActiveXObject('PowerPoint.Application');
- objApp.Visible = true;
-
- while(!WSH.StdIn.AtEndOfStream){
- var strFile = WSH.StdIn.ReadLine();
- var strName = fso.GetBaseName(strFile);
- var strNewFile = dstDir + strName + '.ppt';
- var i = 0;
- while(fso.FileExists(strNewFile))strNewFile = dstDir + strName + '(' + (++i) + ').ppt';
- var objPres = objApp.Presentations.Open(strFile, false, false, false);
- objPres.SaveAs(strNewFile, 1, false);
- objPres.Close();
- }
-
- objApp.Quit()
复制代码
|