Start / Stop / Enable / Disable Terminal services from command line
来源:互联网 发布:只知新浪博客呢称 编辑:程序博客网 时间:2024/05/07 05:31
http://www.windows-commandline.com/2010/10/start-terminal-services-command-line.html
How to start Terminal Services from command line?
We can start Terminal Services from command line by running the command given below.
net start TermService
If the service is already running you will get the message ‘The requested service has already been started.‘
Sometimes you may get an error that the service could not be started.
Thishappens when Terminal Services is disabled through registry hack. Youcan fix this by running the below registry change command.
reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v TSEnabled /t REG_DWORD /d 1 /f
Youneed to reboot the computer for the changes to take effect. Afterreboot terminal services starts automatically or you can start theservice using net start command as mentioned above.
How to stop Terminal Services from command line?
Terminal Services can’t be stopped like other services. You get the below error when you attempt the same.
How to restart Terminal services from command line?
Since Terminal Services can’t be stopped there is no straightforward way we can do this.Microsoft says this is by design.But in some cases restarting termninal services could be possible bykilling the svchost process that runs the terminal services.We can usetasklist and taskkill commands for this.
First get the process id of the terminal services process
tasklist /svc | findstr /C:TermService
Checkif Terminal sevices is the only service running in this svchost. If thesvchost is shared with other services then you can stop readingfurther. Restarting terminal services is not possible on your machine.
On my machine I have got the following output.
As you can see DcomLaunch and TermServiceboth share the same svchost process. In this case I can’t kill theprocess as it stops the other service also. (Note that DcomLaunch is anessential service on the system and killing it can even shutdown thesystem)
In the case of svchost not being sharedwith any other service you can go ahead and kill TermService process bythe following command.
taskkill /F /PID process_id
How to disable Terminal Services from command line?
We can run the below command to disable terminal services.
sc config TermService start= disabled
How to enable Terminal Services from command line?
sc config TermService start= auto
(or)
sc config TermService start= demand
- Start / Stop / Enable / Disable Terminal services from command line
- Enable/disable a device from the command line
- How enable/disable windows feature from command line
- sublime text 2 start from command line
- enable or disable system services
- Stop Delete OR Disable Services
- enable usb tethering via command line failed
- how to enable /disable networking by command in ubuntu12.04
- DSO missing from command line
- Start OpenOffice.org using the command line
- Start/Stop the Workflow Services in Oracle Apps
- Stop and Start OBIEE 11g Services in Linux
- shell bash script to start and stop named services
- 当你需要用命令行执行putty时(When you need start putty from command line)
- enable wireless zero configuration service via command line
- 如何从Terminal Command Line编译并运行Scope
- How to use VirtualBox in Terminal / Command line
- adb shell command -- dumpsys, am, start , stop, screenrecord, logcat ...
- extjs 不显示 但是不报错
- vim复制,粘贴,删除,撤销,替换,光标移动等用法
- 浅析Linux下core文件
- 学生信息管理系统汇编实现
- Android 音频,视频资源管理与播放
- Start / Stop / Enable / Disable Terminal services from command line
- LINK : warning LNK4098: 默认库“LIBCMTD”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
- 解决公司oracle数据库服务器,在不能上网的情况下数据库也能正常的在局域网中使用
- 【语法】property synthesize
- 详解DNS安装及配置多个二级域名的三种方法(图文教程)
- 终于搞懂了,预编译头文件(转)
- Blaze Data Services还是LiveCycle Data Services?
- java调用浏览器
- 在Perl中使用Net::SMTP_auth发送邮件 .