1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What Don't I Understand About @SERVICE

Discussion in 'Support' started by BitPusher, May 9, 2009.

  1. BitPusher

    Joined:
    Jan 9, 2009
    Messages:
    40
    Likes Received:
    0
    In:
    TCC 10.00.67 Windows XP [Version 5.1.2600]
    TCC Build 67 Windows XP Build 2600 Service Pack 3
    Registered to Carl Johnson - 1 System License

    I'm trying to use @SERVICE to (initially) check if a service is running or not. First I issued a SERVICES command with the following result:
    [C:\]services MSSQL$SQLX2005_I0
    MSSQL$SQLX2005_I0 (SQL Server (SQLX2005_I0)) Running

    Then I issued the following @SERVICE command but the result doesn't look anything like what the Help documents:
    [C:\]ECHO %@SERVICE[MSSQL$SQLX2005_I0,2]
    5898240

    [C:\]ECHO %_?
    0

    Info 2 is supposed to give the "current state of the service", but I get the same result whether or not the service is running or stopped. What am I doing wrong?

    Carl
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    On Sat, 09 May 2009 19:24:58 -0500, BitPusher <> wrote:

    |Then I issued the following @SERVICE command but the result doesn't look anything like what the Help documents:
    |[C:\]ECHO %@SERVICE[MSSQL$SQLX2005_I0,2]
    |5898240
    |
    |[C:\]ECHO %_?
    |0
    |
    |Info 2 is supposed to give the "current state of the service", but I get the same result whether or not the service is running or stopped. What am I doing wrong?

    None of it makes much sense:

    for /L %i in (1,1,5) echo %@service[lanmanworkstation,%i]
    7471215
    2097259
    7274601
    7471184
    6881390
    --
    - Vince
     
  3. fromano

    Joined:
    May 20, 2008
    Messages:
    110
    Likes Received:
    0
    try start/stop/query, 2 is not supported

    Usage: @SERVICE[[\\MACHINE,]servicename,[query|start|stop]]

    e.g:

    echo %@service[MSSQL$MSSMLBIZ,query]
    Running

    echo %@service[MSSQL$MSSMLBIZ,start]
    MSSQL$MSSMLBIZ failed.

    echo %@service[MSSQL$MSSMLBIZ,stop]
    Stop service MSSQL$MSSMLBIZ request sent.

    echo %@service[MSSQL$MSSMLBIZ,start]
    Start service MSSQL$MSSMLBIZ request sent.

    echo %@service[MSSQL$MSSMLBIZ,query]
    Start Pending


    echo %@service[MSSQL$MSSMLBIZ,query]
    Running

    HTH
    - Federico




    ________________________________
    From: BitPusher <>
    To: fromano@pacbell.net
    Sent: Saturday, May 9, 2009 5:24:46 PM
    Subject: [Support-t-1138] What Don't I Understand About @SERVICE

    In:
    TCC 10.00.67 Windows XP [Version 5.1.2600]
    TCC Build 67 Windows XP Build 2600 Service Pack 3
    Registered to Carl Johnson - 1 System License

    I'm trying to use @SERVICE to (initially) check if a service is running or not. First I issued a SERVICES command with the following result:
    [C:\]services MSSQL$SQLX2005_I0
    MSSQL$SQLX2005_I0 (SQL Server (SQLX2005_I0)) Running

    Then I issued the following @SERVICE command but the result doesn't look anything like what the Help documents:
    [C:\]ECHO %@SERVICE[MSSQL$SQLX2005_I0,2]
    5898240

    [C:\]ECHO %_?
    0

    Info 2 is supposed to give the "current state of the service", but I get the same result whether or not the service is running or stopped. What am I doing wrong?

    Carl
     
  4. fromano

    Joined:
    May 20, 2008
    Messages:
    110
    Likes Received:
    0
    try start/stop/query, 2 is not supported

    Usage: @SERVICE[[\\MACHINE,]servicename,[query|start|stop]]

    e.g:

    echo %@service[MSSQL$MSSMLBIZ,query]
    Running

    echo %@service[MSSQL$MSSMLBIZ,start]
    MSSQL$MSSMLBIZ failed.

    echo %@service[MSSQL$MSSMLBIZ,stop]
    Stop service MSSQL$MSSMLBIZ request sent.

    echo %@service[MSSQL$MSSMLBIZ,start]
    Start service MSSQL$MSSMLBIZ request sent.

    echo %@service[MSSQL$MSSMLBIZ,query]
    Start Pending

    echo %@service[MSSQL$MSSMLBIZ,query]
    Running

    HTH
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    On Sat, 09 May 2009 21:22:49 -0500, fromano <> wrote:

    |try start/stop/query, 2 is not supported
    |
    |Usage: @SERVICE[[\\MACHINE,]servicename,[query|start|stop]]

    That's nothing like TCC's help suggests. And it doesn't work here:

    echo %@service[lanmanworkstation,query]
    lanmanworkstation,query

    sc query lanmanworkstation

    SERVICE_NAME: lanmanworkstation
    TYPE : 20 WIN32_SHARE_PROCESS
    STATE : 4 RUNNING
    (STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
    WIN32_EXIT_CODE : 0 (0x0)
    SERVICE_EXIT_CODE : 0 (0x0)
    CHECKPOINT : 0x0
    WAIT_HINT : 0x0
    --
    - Vince
     
  6. fromano

    Joined:
    May 20, 2008
    Messages:
    110
    Likes Received:
    0
    Sorry, forgot to mention that if he's using FedUtils9 that's the syntax, if he doesn't have FedUtils9 plugin installed then I don't know
     
  7. BitPusher

    Joined:
    Jan 9, 2009
    Messages:
    40
    Likes Received:
    0
    I'm just using "plain" TCC - no plugins.

    I suspect that either the Help for @SERVICE need major work or that this is a bug.

    Carl
     
  8. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Need help index entry for @SERVICE


    I was unfamiliar with that function so I tried to look it up in the help file.

    Rex, there's no index entry for @SERVICE, but there is a link to the @SERVICE page from the functions by category page.
     
  9. Peter Bratton

    Joined:
    Jul 1, 2008
    Messages:
    81
    Likes Received:
    0
    I get exactly the same values, regardless of the service:
    for /l z in (1,1,5) echo %z - %@service[nncron,%z]
    1 - 7471215
    2 - 2097259
    3 - 7274601
    4 - 7471184
    5 - 6881390
    --
    Peter
     
  10. BitPusher

    Joined:
    Jan 9, 2009
    Messages:
    40
    Likes Received:
    0
    This is a "bump" of my OP since I haven't seen any "official" reply to this issue.

    Since the new @SERVICE function was one of the three reasons I upgraded from V9 to V10, I would like to have it fixed or the documentation updated to describe how to make it work.

    Carl
     

Share This Page