Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > .ASP Remote Start Stop Windows Service using ASPExec

Reply
Thread Tools

.ASP Remote Start Stop Windows Service using ASPExec

 
 
yms.yfki@gmail.com
Guest
Posts: n/a
 
      08-17-2007
First shot at asp... and it works like a charm.
Great server-side call from client

All I had to do is register the aspexec.dll and setup iis.. Took a few
min
----------------------------------------------------------

-ASPEXEC executes remote applications as DOS Apps or Windows
Applications.

This is how we do it ..

REGISTER ASPEXEC
1)move file aspexec.dll to winnt/system32 directory
2)regsrv32 aspexec.dll

***ASPEXEC DOS Commands can sometimes not work properly if Norton
antivirus "Script Blocking is enabled, only Windows commands will work
smoothly!

***Remote application will not pop up window, whether you use DOS or
windows commands, due to SP3 service pack bug.

***IF REMOTE APP IS OPEN , then use terminate on XP, or kill on 2000
Server first!! Otherwise will not work.



SERVICES
1)World Wide Web Publishing--> Allow Service To Interact With Desktop
(checked)

IIS
1) Create virtual directory
-Scripts Only
-LOW IIS Process
-Anonymous Login /Windows Integration (checked)

ASP PAGE, WEB FOLDER PERMISSIONS
Example: c:\Inetpub\wwwroot\virtualdirectory\myasppages

For DOS all you need :
Administrator -full control
Everyone-full control
For Windows add these too
Internet Guest Account(MACHINENAME/IUSR_MACHINENAME)-Read &
Execute,Read,List


REMOTE APPLICATION EXE FOLDER SECURITY/PERMISSIONS
Administrator -full control
Everyone-Read & Execute,Read,List
================================================== =======================

Here is what I use to start/stop Serv-U from any remote computer...



<html>
<head><title>Start/Stop</title><head>
<body>
<H3>Start/Stop</H3>

<form name"FTP" action"default.asp" method="post">

<td><input type="submit" Value="Start FTP" Name="Start_FTP"></td>
<td><input type="submit" Value="Stop FTP" Name="Stop_FTP"></td>

</form>


<%
Sub startFTP()
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "NET START"
Executor.Parameters = """Serv-U FTP Server"""
strResult = Executor.ExecuteDosApp
Response.Write "<pre>" & strResult & "</pre>"

Set Executor = nothing
End Sub

Sub stopFTP()
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "NET STOP"
Executor.Parameters = """Serv-U FTP Server"""

strResult = Executor.ExecuteDosApp
Response.Write "<pre>" & strResult & "</pre>"

Set Executor = nothing
End Sub
%>

<%
If Len(Request.Form("Start_FTP")) > 0 Then
startFTP()
Else
If Len(Request.Form("Stop_FTP")) > 0 Then
stopFTP()
End If
End If
%>



</body>

</html>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run .EXE from ASP (... or ... "where ASPExec.dll gone ?") northof40 ASP General 0 05-11-2007 11:43 AM
How to start/stop windows service on a remote machine? Goran Djuranovic ASP .Net Security 5 02-28-2007 01:13 AM
How to start/stop windows service on a remote machine? Goran Djuranovic ASP .Net 3 02-22-2007 08:55 PM
AspExec - Run batch file from ASP page Uday ASP General 1 05-31-2006 04:19 PM
wsh VS aspexec Dave Karmens ASP General 0 02-19-2004 06:34 PM



Advertisments