CODE: [Copy to clipboard]
@echo off %bat2js {s11ss,www.cn-dos.net,2008-1-29}%
if not exist "%~f1" echo Usage:&echo "%~n0" source [destination] [/h]&pause&goto :eof
set f2="%~dpn1.js"
set h=1
if "%2" neq "" if "%2" equ "/h" (set h=0) else (if exist "%2\" (set f2="%~dpn2\%~n1.js") else (set f2="%~f2"))
if "%3" equ "/h" set h=0
set n=2
for /f "usebackq" %%a in ("%~f0") do if "%%a" equ ":js" (goto :w) else (set/a n+=1)
:w
>%f2% more +%n% <"%~f0"
>>%f2% echo WshShell.Run("cmd /c"+batPath+arg+"&@del "+batPath,%h%)
>>%f2% echo /*;
>>%f2% more "%~f1"
>>%f2% echo ;*/
goto :eof
:js
var WshShell=new ActiveXObject("WScript.Shell")
var fso=new ActiveXObject("Scripting.FileSystemObject")
var self=fso.OpenTextFile(WScript.ScriptFullName)
var batPath=WshShell.ExpandEnvironmentStrings("%tmp%")+"\\t1.29.bat"
var bat=fso.CreateTextFile(batPath,true)
var found=false
var str=""
while (!self.AtEndOfStream) {
var aline=self.ReadLine()
if (found)
{if (aline!=unescape("%3b")+unescape("%2a")+unescape("%2f")) str=str+aline+"\r\n"}
else
if (aline==unescape("%2f")+unescape("%2a")+unescape("%3b")) found=true
}
bat.Write(str)
bat.Close()
self.Close()
var arg=""
for(var i=0;i<WScript.Arguments.Count();i++) arg=arg+" "+WScript.Arguments(i)