运行前备份 确定源文件编码为ANSI- 1>1/* :
- @echo off
- dir /b /a-d *.reg| cscript -nologo -e:jscript "%~f0"
- pause&exit
- */
- while (!WSH.StdIn.AtEndOfStream){
- var file = WScript.StdIn.ReadLine();
- binRead( file );
- }
- function binRead( path ) {
- var stream, cont, content;
- stream = new ActiveXObject("ADODB.Stream");
- stream.Type = 2;
- stream.charset = 'gbk';
- stream.open();
- stream.loadFromFile(path);
- content = stream.ReadText();
- stream.Position = 0
- stream.SetEOS()
- stream.Type = 2;
- stream.charset = 'UTF-16';
- stream.writetext(content);
- stream.SaveToFile(path, 2);
- stream.Close
- }
复制代码 |