不知行否
pdf不带书签- @if (0)/*==(0)/* echo off
-
- cmd /u /c dir /b /s /a-d *.docx | cscript //nologo //e:jscript //u "%~f0"
- taskkill /F /IM winword.exe 2>nul
-
- pause&exit/b
- rem */@end
-
- var nil=null,f=[];
- while (!WScript.StdIn.AtEndOfStream) {
- s=WScript.StdIn.ReadLine();
- f.push(s);
- }
-
- var i,p,file,fso=GetObject("new:scripting.filesystemobject");
- var wa=GetObject("new:word.application");
- wa.Visible=false;wa.DisplayAlerts=false;wa.ScreenUpdating=false;
-
- for (i in f){
- p=f[i].split('.');
- p.pop();
- p.push('pdf');
- if (fso.FileExists(p.join('.'))){}
- else {
- file=wa.Documents.Open(f[i]);
- file.SaveAs2(p.join('.'),17);
- file.Close(false);
- }
- }
-
- wa.Visible=true;wa.DisplayAlerts=true;wa.ScreenUpdating=true;
- wa.Quit();wa=nil;
复制代码
|