How to start Win NT Service through ASP

Results 1 to 2 of 2

Thread: How to start Win NT Service through ASP

  1. #1
    Imran Uddin Guest

    Default How to start Win NT Service through ASP

    Hi<BR><BR>Is there any way to start a WinNT service remotely through ASP.<BR><BR>Thanx<BR><BR>Imr@n

  2. #2
    Jesse Bagans Guest

    Default RE: How to start Win NT Service through ASP

    Sure, you can use ASP to create an instance the WSH (Windows Scripting Host). Using the windows scripting host you can essentially perform most actions that you normally could while sitting in front of the console. <BR><BR>For example, the following lines will create an instance of the scriping host shell object, and then run the command in quotes which tells WSH to run the execute the command following "/C" at the command prompt, "net stop/start" says that you are stopping/starting a service, and "/y" the switch for the prompt, in this case to confirm that you are stopping the IIS Admin and all dependent services, be very careful with this. Whatever service name you put after "net start" or "net stop" will be the service you want to stop, but make sure you know what other services may depend on it:<BR><BR>Set obWS = CreateObject("WScript.Shell")<BR>obWS.Run ("command /C net stop iisadmin /y")<BR>Set obWS = Nothing<BR><BR>For info on the WSH, syntax, etc. see<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts