cmd常见命令

win获取当前路径

方法1:命令   %cd%  或者  !cd!  ,取得是运行的环境目录

方法2:命令  %~dp0   ,取得了bat的文件所在目录

启动某服务

net start (服务名称)

停止某服务

 net stop  (服务名称)

禁用某服务

sc config (服务名称)start= disabled  

启用某服务

(注意:start=后面有一个空格.)
sc config (服务名称)start= auto    

猜你喜欢

转载自blog.csdn.net/u013412772/article/details/80803887