.ASP Remote Start Stop Windows Service using ASPExec

Discussion in 'ASP General' started by yms.yfki@gmail.com, Aug 17, 2007.

  1. Guest

    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>
    , Aug 17, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Goran Djuranovic
    Replies:
    3
    Views:
    4,058
    Goran Djuranovic
    Feb 22, 2007
  2. Goran Djuranovic

    How to start/stop windows service on a remote machine?

    Goran Djuranovic, Feb 21, 2007, in forum: ASP .Net Security
    Replies:
    5
    Views:
    458
    Steven Cheng[MSFT]
    Feb 28, 2007
  3. Dave Karmens

    wsh VS aspexec

    Dave Karmens, Feb 19, 2004, in forum: ASP General
    Replies:
    0
    Views:
    95
    Dave Karmens
    Feb 19, 2004
  4. Uday
    Replies:
    1
    Views:
    149
  5. northof40
    Replies:
    0
    Views:
    150
    northof40
    May 11, 2007
Loading...

Share This Page