简体   繁体   中英

Start/Stop windows services remotely via bat file or cmd

is there any solution how to stop/start services (eg. spooler) via cmd or bat file.

I tried solutions from google but no one successful.

Solution 1:

PsExec \\192.168.1.175 -u username -p password -h stop spooler

with the " Solution 1 " I got this error.

在此处输入图像描述

Solution 2

sc \\192.168.1.175 stop spooler

with the " Solution 2 " I got this error.

在此处输入图像描述

SOLVED

OPTION 1: I got the solution from this URL https://docs.microsoft.com/en-us/troubleshoot/windows-server/windows-security/user-account-control-and-remote-restriction#how-to-disable-uac-remote-restrictions

OPTION 2

net use \192.168.1.175\admin$ password /user: username

and executing this command with CMD

sc \\192.168.1.175 stop spooler

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM