Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 从批处理文件远程关闭_Batch File_Networking - Fatal编程技术网

Batch file 从批处理文件远程关闭

Batch file 从批处理文件远程关闭,batch-file,networking,Batch File,Networking,我目前正在尝试编写一个短批处理文件,以关闭连接到网络的PC。我将shutdown命令与-m开关一起使用,如下例所示: shutdown -r -m \\192.168.0.3 -t 60 语法似乎正确,但终端返回以下语句: 找不到网络路径 因此,尽管有一台PC连接到该IP,但终端返回时会出错 我如何解决这个问题?是否需要打开特定的后台服务?请在comp name后面使用put u'r-r参数 set ip= set seconds= shutdown -m \\%ip% -r -f -t

我目前正在尝试编写一个短批处理文件,以关闭连接到网络的PC。我将
shutdown
命令与
-m
开关一起使用,如下例所示:

shutdown -r -m \\192.168.0.3 -t 60
语法似乎正确,但终端返回以下语句:

找不到网络路径

因此,尽管有一台PC连接到该IP,但终端返回时会出错


我如何解决这个问题?是否需要打开特定的后台服务?

请在comp name后面使用put u'r-r参数

set ip=
set seconds= 
shutdown -m \\%ip% -r  -f -t %seconds%
shutdown –m \\computername –r –f –c “I’m restarting your computer for maintenance.  Please save your work now.” –t 120

要使用windows界面调用此工具,请在cmd上键入
shutdown-i
ping 192.168.0.3
时会发生什么?所有发送到192.168.0.3的包都会返回;这不是数据丢失。感谢回复,但无论如何,您的语句并不能解决问题,因为它们只是用要定义的变量替换已定义的参数。