Possible to start a service from a DOS window ?

  • Thread starter Sébastien de Mapias
  • 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
 
J

John John

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

Shenan Stanley

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top