Possible to start a service from a DOS window ?

  • Thread starter Thread starter Sébastien de Mapias
  • Start date Start date
S

Sébastien de Mapias

Hi,
Is there a way to start a Windows service from the DOS prompt ?
(I'm on Windows XP pro SP2)
When typing 'tasklist /svc' in a DOS box, I can see in particular
TNSLSNR.EXE 2800 OracleOraDb11g_home1TNSListener
oracle.exe 2360 OracleServiceTEST11G

=> I'd like to be able to start (and stop) these 2 services from
a .bat
file at will.

Thanks a lot...
Regards,
SR
 
Sébastien de Mapias said:
Hi,
Is there a way to start a Windows service from the DOS prompt ?
(I'm on Windows XP pro SP2)
When typing 'tasklist /svc' in a DOS box, I can see in particular
TNSLSNR.EXE 2800 OracleOraDb11g_home1TNSListener
oracle.exe 2360 OracleServiceTEST11G

=> I'd like to be able to start (and stop) these 2 services from
a .bat
file at will.

Use the NET command.

net stop servicename
net start "service name"

By the way it isn't a DOS box, there is no DOS in Windows NT operating
systems, it's a (cmd) command prompt or a command session. Nitpicking
maybe but you don't call a computer a Commodore 64 either!

John
 
Sébastien de Mapias said:
Is there a way to start a Windows service from the DOS prompt ?
(I'm on Windows XP pro SP2)
When typing 'tasklist /svc' in a DOS box, I can see in particular
TNSLSNR.EXE 2800 OracleOraDb11g_home1TNSListener
oracle.exe 2360 OracleServiceTEST11G

=> I'd like to be able to start (and stop) these 2 services from
a .bat
file at will.

Net Start "Name of Service" (to start)
Net Stop "Name of Service" (to stop)

You need the full name of the service... If the service is running, just
typing "net start" will list out all started services and you can pull the
name from that list.
 
Back
Top