PS:簡單易懂...好設定...^_^

----------------------------------------------
ping_DNS.asp   Ping to 中華電信 DNS
ping_USER.asp  Ping to 用戶端IP位置
----------------------------------------------
權限修改後,可執行磁碟相關指令....
修改IIS檔案所在資料匣
1.資料匣-滑鼠右鍵-內容(R)
2.應用程式設定-建立(E)
3.使用權限(P)-不用改變--指令
4.應用程式保護(N)-改為-低(IIS處理程序)
----------------------------------------------

執行 Server端 EXE程式
ASPEXEC 3.0語法使用說明..



1.使用ASPEXEC之前,請先註冊ASPEXEC.DLL這一個物件
  其註冊語法如下：
  Regsvr32 ASPEXEC.DLL
  請將 ASPEXEC.DLL 複製到 windows\system32 or winnt\system32



2.語法說明

  Set Executor = Server.CreateObject("ASPExec.Execute")
  '這是建立物件名稱的語法

  Application
  '這是執行的應用程式的檔名稱與路徑
  Executor.Application = "ping.exe"

  Parameters
  '這是執行的應用程式的參數
  Executor.Parameters = " 168.95.1.1"

  TimeOut
  '這是執行的應用程式的等待時間(ms)
  Executor.TimeOut = "5000"

  ShowWindow
  '這是執行的應用程式時是否要顯示視窗
  Executor.ShowWindow = Ture

  ExecuteDosApp
  '這是執行DOS的應用程式完成後,並回傳執行所顯示的訊息
  Executor.ExecuteDosApp

-----------------------------(用不到)-----------------------------
  ExecuteWinAppAndWait (用不到)
  'Execute the specified app as a Windows app and wait for the specified timeout if exec is successful

  ExecuteWinApp (用不到)
  '這是執行Win的應用程式後,直接回傳執行是否成功
  Executor.ExecuteWinApp
(天阿...Win執行檔被常駐在伺服器的背景,無法釋放...需重開機才消失)
-----------------------------(用不到)-----------------------------



3.範例 For WinApp
<%
  Set Executor = Server.CreateObject("ASPExec.Execute")
  Executor.Application = "notepad.exe"
  Executor.Parameters = "c:\autoexec.bat"
  Executor.ShowWindow = True
  Response.Write "Attempting to execute " & Executor.Application & "<br>"
  strResult = Executor.ExecuteWinApp
  Response.Write "The result of this call was: " & strResult
%>

結果:回傳狀態 ok 
     但Win執行檔被常駐在伺服器的背景,無法釋放...=.=q



4.範例 For DOSApp
<%
  Set Executor = Server.CreateObject("ASPExec.Execute")
  Executor.Application = "Ping"
  Executor.Parameters = " 168.95.1.1"
  Executor.ShowWindow =  Ture
  Response.Write Executor.Application & "　" Executor.Parameters
  strResult = Executor.ExecuteDOSApp
  Response.Write "<pre>"& strResult &"</pre>"
  Set Executor = nothing
%>

結果:DOS執行檔完後才會顯示訊息,如果下了無止盡的參數...
     PING 168.95.1.1 /t .....畫面出不來=.=q...小心使用