[SOLVED] WIN7 Services

Discussion in 'Windows 7' started by leebo_28, Oct 29, 2016.

  1. leebo_28

    leebo_28 MDL Senior Member

    Jun 12, 2011
    460
    170
    10
    #1 leebo_28, Oct 29, 2016
    Last edited: Oct 31, 2016
    Hey , could someone please make a .bat or .reg that would turn these four services to enabled and start automatically.

    Windows 7 Pro 64X.. Thanks in advance!

    1-) DHCP Client
    2-) NET TCP Port Sharing Service
    3-) SSDP Discovery
    4-) UPnP Device Host
     
  2. Michaela Joy

    Michaela Joy MDL Crazy Lady

    Jul 26, 2012
    3,624
    3,919
    120
    #2 Michaela Joy, Oct 30, 2016
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Compo

    Compo MDL Member

    Mar 29, 2011
    137
    104
    10
    #3 Compo, Oct 31, 2016
    Last edited by a moderator: Apr 20, 2017
    This may suit your request.
    Code:
    @FOR %%A IN (DHCP NetTcpPortSharing SSDPSRV upnphost) DO (
    @FOR /F "TOKENS=1-3 DELIMS=: " %%B IN ('SC QC %%A 2^>NUL') DO (
    @IF %%B==START_TYPE @IF %%C NEQ 2 SC CONFIG %%A START= AUTO
    @FOR /F "TOKENS=1,3 DELIMS=: " %%E IN ('SC QUERY %%A') DO (
    @IF %%E==STATE IF NOT [%%F]==[RUNNING] SC START %%A)))
    I would however like to mention that the DHCP service should by default start automatically and both SSDPSRV and upnphost, (which has a dependency on SSDPSRV), should already by default run only when needed.
     
  4. leebo_28

    leebo_28 MDL Senior Member

    Jun 12, 2011
    460
    170
    10
    #4 leebo_28, Oct 31, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Hey Compo! , thanks for responding.. Worked perfectly!