Windows Perl Scripting Forums » Perl

Updating Service Entry

(2 posts)


  1. dsully

    I'd like to be able to toggle a service's start_type from AUTO to DEMAND.

    It doesn't look like Win32::Daemon can do that, except with a DeleteService() followed by a CreateService() which I'd like to avoid.

    I've been told that there are Win32::Service extensions that might help

    Posted 9 years ago #
  2. Dave
    Perl guy

    You can either use Win32::Lanman's ChangeServiceConfig() method or Win32::Daemon's ConfigureService() method. The latter is discussed in chapter 8 of my second book "Win32 Perl Scripting: The Administrator's Handbook" ( Example 8.5 from the book briefly demonstrates how to modify a service's configuration. In your case, however, you would want to change the name of the service in the %ServiceConfig hash, remove the credentials and add the 'start_type' field:

    %ServiceConfig = (
        name       =>  'YourServiceName',
        machine    =>  "\\\\" . Win32::NodeName(), # Represent the local machine
        start_type =>  SERVICE_AUTO_START,

    Note that you could use a start_type of:

    I'll ensure that our web page on this ( is updated to reflect this.
    Posted 9 years ago #

RSS feed for this topic


You must log in to post.