本帖最后由 apang 于 2015-3-20 23:54 编辑
试试- @set @n=0;/* & echo off
- for /f "tokens=1*delims=/" %%a in ('dir /b *.htm^|cscript -nologo -e:jscript "%~0"') do (
- ren "%%a" "%%b%%~xa"
- )
- pause & exit/b & rem */
-
- while (!WScript.StdIn.AtEndOfStream) {
- var file = WScript.StdIn.ReadLine();
- var ado = new ActiveXObject("Adodb.Stream")
- ado.Type = 2;
- ado.Mode = 3;
- ado.CharSet = "BIG5";
- ado.Open();
- ado.LoadFromFile(file);
- var name = ado.ReadText.match(/<title>(.*)<\/title>/i)[1];
- WScript.Echo(file + "/" + name);
- ado = null
- }
复制代码
|