Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

launch a program on the server

Status
Not open for further replies.

clear88

Programmer
Nov 29, 2001
24
CN
hi there,

is there a way to launch a program via ASP page?

For example

When user access the ASP page on the server_name, it an launch a program under c:\test\test.exe on server_name

cheers
 
clear88,

I use this as a function:

'****************************************
Function Remote_Cmd(Server, accnt, pwd, strCmd)
'****************************************
On Error Resume Next
Set Locator = CreateObject("WbemScripting.SWbemLocator")
user = server & "\" & accnt

Set Service = Locator.ConnectServe (Server, "root\cimv2", user, pwd)
Service.Security_.impersonationlevel = 3
Set Process = Service.Get("Win32_Process")
intStatus = Process.Create("cmd /C " & strCmd, null, null, intProcessId)
' response.write err.number & " " & err.description
If err.number <> 0 then
Remote_Cmd = err.number
else
Remote_Cmd = 0
End If
End Function


Cheers,
fengshui_1998
 
thanks for your help, I will get it try later...!


cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top