Announcement

Collapse
No announcement yet.

Newbie: How to control windows services

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie: How to control windows services

    I'm working on developing some scripts that will configure my company's print server software with some Demonstration Data. In order to put the configuration into effect, I need to restart some of the Windows services. Right now I can do all this by calling a .bat file (net stop/net start) from the script, but would like to try and control the services from the script directly.

    I am making the assumption that the interactive user is a local administrator.

    I don't see anything in the help or scripting guide included with APMS, but have seen some references to controlling services with other IR software packages. Any hints would be appreciated

    TIA

    Robert Crews
    Barr Systems, Inc.

  • #2
    Welcome!!

    1. Download this FREE Plug-In: Service Action Plugin from my website

    2. Shutdown AMS and Install the plugin

    3. Open the sample application

    4. Enjoy!

    Actions:
    boolean Service.IsServiceRunning()
    boolean Service.Start()
    boolean Service.Stop()
    Attached Files
    Last edited by Worm; 01-12-2006, 01:17 PM.

    Comment


    • #3
      Wow just what I was looking for! Thanks Kindly!

      Comment


      • #4
        Your're welcome

        Comment


        • #5
          Useful Worm!
          Intrigued

          Comment


          • #6
            Trying your plugin with only mixed success.. I am only able to control services that are named as a single word (i.e. "Alerter"). If there is a space in the service name (i.e. "Print Spooler"), it fails.

            I have tried the following syntax:

            Service.Stop ("Print Spooler")
            Service.Stop ("\"Print Spooler\"")
            and
            Service.Stop ('"Print Spooler'")

            Any thoughts?

            TIA!

            Comment


            • #7
              Hmm, I'll have to look into it a bit and see what I can come up with.

              Comment


              • #8
                Sorry for the delay. To stop the Print Spooler service with this plugin, you need to use the service's name, not the display name.

                The service you want to stop is called: spooler
                Its display name is: Print Spooler

                So use: spooler

                You should be all set.

                The services are listed in:
                HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es

                Using AMS you could easily use the Display Name to get the actual service name too.

                Comment


                • #9
                  this?

                  Service.Stop ("spoolvs.exe")

                  Comment


                  • #10
                    Service.Stop("spooler");

                    Comment


                    • #11
                      working at AMS 7.5?

                      Comment

                      Working...
                      X