Advertisement
Guest User

test

a guest
Nov 22nd, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script language=vbscript>
  4. Option Explicit
  5. Dim WSHShell
  6. Dim Path
  7.  
  8. Sub SetPath()
  9. Dim PathParts, X
  10.  
  11. PathParts = Split(Mid(window.location.pathname, 2), "%")
  12. For X = 1 To UBound(PathParts)
  13. PathParts(X) = _
  14. Chr(CInt("&H" & Left(PathParts(X), 2))) _
  15. & Mid(PathParts(X), 3)
  16. Next
  17. Path = Join(PathParts, "")
  18. Path = Left(Path, InStrRev(Path, "\"))
  19. End Sub
  20.  
  21. Sub btnCScript_onclick()
  22. 'Run: cscript "{path}test.vbs" "{path}"
  23. WSHShell.Run _
  24. "cscript """ & Path & "test.vbs"" """ & Path & """"
  25. window.status = "Script has been run via CScript"
  26. End Sub
  27.  
  28. Sub btnWScript_onclick()
  29. 'Run: wscript "{path}test.vbs" "{path}"
  30. WSHShell.Run _
  31. "wscript """ & Path & "test.vbs"" """ & Path & """"
  32. window.status = "Script has been run via WScript"
  33. End Sub
  34.  
  35. Sub window_onload()
  36. Set WSHShell = CreateObject("WScript.Shell")
  37. SetPath
  38. End Sub
  39.  
  40. Sub window_onunload()
  41. Set WSHShell = Nothing
  42. End Sub
  43. </script>
  44. </head>
  45. <body>
  46. <input type=button id=btnCScript value="Use CScript">
  47. <input type=button id=btnWScript value="Use WScript">
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement