![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-26 23:31 |
47,812 topics / 349,912 posts / today 2 new / 48,264 members |
| 其它操作系统综合讨论区 » How to stop a service in a batch file? |
| Printable Version 3,504 / 15 |
| Floor1 zdx21 | Posted 2008-10-26 17:27 |
| 新手上路 Posts 1 Credits 1 | |
|
Remember there was a command, but I can't remember it. Who remembers?
|
|
| Floor2 slore | Posted 2008-10-26 17:36 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
| Floor3 HAT | Posted 2008-10-26 18:02 |
| 版主 Posts 5,017 Credits 9,023 | |
| Floor4 livesweet | Posted 2008-10-26 23:24 |
| 初级用户 Posts 45 Credits 86 | |
|
net stop is better than sc stop, more stable and less error - prone
|
|
| Floor5 tireless | Posted 2008-10-26 23:40 |
| 银牌会员 Posts 1,122 Credits 2,025 | |
|
How to view the help for net.exe?
C:\>NET /? |
|
| Floor6 bd123456789 | Posted 2008-10-27 08:57 |
| 中级用户 Posts 216 Credits 360 | |
|
net /?
Everything is fine here. Is there a problem with your CMD? |
|
| Floor7 HAT | Posted 2008-10-27 09:37 |
| 版主 Posts 5,017 Credits 9,023 | |
|
I haven't heard of it. Can you give an example to illustrate it?
|
|
| Floor8 yishanju | Posted 2008-10-27 09:54 |
| 银牌会员 Posts 1,357 Credits 1,488 | |
Originally posted by tireless at 2008-10-26 23:40: Is your system a streamlined XP? |
|
| Floor9 yishanju | Posted 2008-10-27 09:56 |
| 银牌会员 Posts 1,357 Credits 1,488 | |
|
View the services started in the system:
C:\Documents and Settings\haige>net start The following Windows services have been started: Application Layer Gateway Service Background Intelligent Transfer Service ColdFusion MX 7 Search Server COM+ Event System Computer Browser Cryptographic Services DCOM Server Process Launcher DHCP Client |
|
| Floor10 yishanju | Posted 2008-10-27 09:57 |
| 银牌会员 Posts 1,357 Credits 1,488 | |
|
Stop the system service:
C:\Documents and Settings\haige>net stop Themes Themes service has been stopped successfully. |
|
| Floor11 yishanju | Posted 2008-10-27 10:03 |
| 银牌会员 Posts 1,357 Credits 1,488 | |
|
net stop can only stop the service and does not change the startup type of the service. The default startup type of Themes is Automatic. If you use NET STOP to stop the Themes service, the Themes service will still run again after restarting.
Attachments 未命名.JPG (46.62 KiB) |
|
| Floor12 yishanju | Posted 2008-10-27 10:07 |
| 银牌会员 Posts 1,357 Credits 1,488 | |
|
The sc command is a bit better. It can start services and also change the startup type of services. NET START and NET STOP are just for simply starting and stopping services.
|
|
| Floor13 tireless | Posted 2008-10-27 10:09 |
| 银牌会员 Posts 1,122 Credits 2,025 | |
Originally posted by yishanju at 2008-10-27 09:54 AM: Yes. Which file is missing? |
|
| Floor14 yishanju | Posted 2008-10-27 10:24 |
| 银牌会员 Posts 1,357 Credits 1,488 | |
|
The so-called streamlining, of course, is that a lot of infrequently used files are removed, and help files and such are all streamlined away, right
|
|
| Floor15 dato | Posted 2008-10-27 12:23 |
| 高级用户 Posts 377 Credits 916 | |
|
I always use sc. Of course, there is a sequence for service loading. The following two services are related to each other, so you need to wait for the OracleDBConsoleorcl service above to be loaded completely before the OracleCSService below can start normally.
%systemroot%\system32\sc.exe config OracleDBConsoleorcl start= DEMAND %systemroot%\system32\sc.exe start OracleDBConsoleorcl rem It takes 90 seconds to start the OracleDBConsoleorcl service for 3800+ rem %systemroot%\system32\ping.exe -n 90 127.0.0.1>nul %systemroot%\system32\sc.exe config OracleCSService start= DEMAND %systemroot%\system32\sc.exe start OracleCSService |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |