Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script language=vbscript>
- Option Explicit
- Dim WSHShell
- Dim Path
- Sub SetPath()
- Dim PathParts, X
- PathParts = Split(Mid(window.location.pathname, 2), "%")
- For X = 1 To UBound(PathParts)
- PathParts(X) = _
- Chr(CInt("&H" & Left(PathParts(X), 2))) _
- & Mid(PathParts(X), 3)
- Next
- Path = Join(PathParts, "")
- Path = Left(Path, InStrRev(Path, "\"))
- End Sub
- Sub btnCScript_onclick()
- 'Run: cscript "{path}test.vbs" "{path}"
- WSHShell.Run _
- "cscript """ & Path & "test.vbs"" """ & Path & """"
- window.status = "Script has been run via CScript"
- End Sub
- Sub btnWScript_onclick()
- 'Run: wscript "{path}test.vbs" "{path}"
- WSHShell.Run _
- "wscript """ & Path & "test.vbs"" """ & Path & """"
- window.status = "Script has been run via WScript"
- End Sub
- Sub window_onload()
- Set WSHShell = CreateObject("WScript.Shell")
- SetPath
- End Sub
- Sub window_onunload()
- Set WSHShell = Nothing
- End Sub
- </script>
- </head>
- <body>
- <input type=button id=btnCScript value="Use CScript">
- <input type=button id=btnWScript value="Use WScript">
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement