Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Net Stop service ... question  (Read 2758 times)

0 Members and 1 Guest are viewing this topic.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Net Stop service ... question
« on: February 06, 2009, 11:47:43 AM »
I am trying to figure out a service name for a TCI VT100 Service so I can NET STOP and NET START it to allow the users reset the service through a batch file shortcut on their desktop.

I was wondering if anyone knew of a way to find the service name such as when looking at the print spooler it doesnt tell you that you can execute NET STOP SPOOLER to stop the service and NET START SPOOLER to start the print service back up. When you look at the services Properties you would see that it is pointing at C:\WINDOWS\system32\spoolsv.exe ..... so somewhere the system knows that SPOOLER = spoolsv.exe for the service.

I am trying to find it for TCI VT100 and I tried a bunch of combinations of trial and error on hoping I would find the declaration that will match the service.

So I am here asking if anyone knows of a way to find the actual service name so I can NET STOP and NET START That TCI VT100 service?

Thanks ???

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Net Stop service ... question
« Reply #1 on: February 07, 2009, 05:16:49 AM »
No guarantees, but this little script may help you match up the executable with the service name.

Code: [Select]
On Error Resume Next
strComputer = "."

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Service", "WQL", _
            wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems
  WScript.Echo ""
  WScript.Echo "StartName: " & objItem.StartName
  WScript.Echo "PathName: " & objItem.PathName
Next

Save the script with a vbs extension and run from the command prompt as cscript scriptname.vbs

To make it easier to read, you can also redirect the output of cscript to a file.

Good luck.  8)

EDIT: research turned up the service name as the target of a start/stop command.
« Last Edit: February 07, 2009, 04:56:57 PM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein