Batch file 如何在尝试通过cmd从PuTTY执行命令时忽略/抑制错误

Batch file 如何在尝试通过cmd从PuTTY执行命令时忽略/抑制错误,batch-file,ssh,cmd,putty,Batch File,Ssh,Cmd,Putty,我想在我的Windows计算机上使用.bat文件锁定我的arch笔记本电脑 我在我的批次中写下: start C:\some_path\putty.exe -load "naptop@nick" -m C:\some_path\remote.cmd 和remote.cmd包含: xfce4-session-logout --suspend;exit 0; 它工作完美!但当我没有internet连接时,我有一个错误: 当脚本无法执行命令时,我是否可以忽略任何错误?不要使用PuTTY自动执行命

我想在我的Windows计算机上使用.bat文件锁定我的arch笔记本电脑

我在我的批次中写下:

start C:\some_path\putty.exe -load "naptop@nick" -m C:\some_path\remote.cmd
和remote.cmd包含:

xfce4-session-logout --suspend;exit 0;
它工作完美!但当我没有internet连接时,我有一个错误:


当脚本无法执行命令时,我是否可以忽略任何错误?

不要使用PuTTY自动执行命令

使用(腻子包装的一部分)。它采用与PuTTY相同的参数。此外,您还需要添加到

使用Plink,您甚至可以直接在命令行上指定命令:

C:\some_path\plink.exe -batch -load "naptop@nick" xfce4-session-logout --suspend;exit 0;

不要使用PuTTY自动执行命令

使用(腻子包装的一部分)。它采用与PuTTY相同的参数。此外,您还需要添加到

使用Plink,您甚至可以直接在命令行上指定命令:

C:\some_path\plink.exe -batch -load "naptop@nick" xfce4-session-logout --suspend;exit 0;

谢谢你!成功了。现在我可以锁定我的两个设备,只需按下鼠标上的附加按钮:)谢谢!成功了。现在我只需按下鼠标上的附加按钮即可锁定两台设备:)