<!-- js<->vbs {Author:s11ss|From:www.cn-dos.net|Date:2008-2-1} -->
<job>
<script language=vbscript>
With WScript.Arguments
If .Count<1 Then .ShowUsage:WScript.Quit
For i=1 To .Count
s=s&vbCrLf&vbCrLf&i&"."&T(.Item(i-1))
Next
End With
WScript.Echo s
Function T(file)
Select Case Right(file,4)
Case ".vbs",".vbe" ext="js"
Case ".jse" ext="vbs"
Case Else If Right(file,3)=".js" Then ext="vbs"
End Select
If ext="" Then T="It's not a vbs or js file: "&file:Exit Function
Set fso=CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(file) Then T="It doesn't exist: "&file:Exit Function
str=getResource(ext)
Set orgf=fso.OpenTextFile(file)
If ext="vbs" Then
While Not orgf.AtEndOfStream
aline=orgf.ReadLine
str=str&vbCrLf&"';"&aline
Wend
Else
str=str&vbCrLf&orgf.ReadAll&vbCrLf&";*/"
End If
orgf.Close
Set newf=fso.CreateTextFile(file&"."&ext,True)
newf.Write str
newf.Close
Set fso=Nothing:Set orgf=Nothing:Set newf=Nothing
T="Created: "&file&"."&ext
End Function
</script>
<!-- usage and resource to use -->
<runtime>
<description>
vbs2js or js2vbs
(Other files won't be changed.)
</description>
<unnamed
name="filename"
helpstring="The file(s) to be changed."
many="true"
required="1"
/>
</runtime>
<resource id=js>
<!
]>
</resource>
<resource id=vbs>
<!
]>
</resource>
</job>