简体   繁体   中英

How to Run another batch script with ssh.net using c#

I want to run a batch script when I connect to another computer using ssh.net

It seems it doesn't work:

SshCommand command = client.RunCommand("C:\mybatch.bat"); 

I can connect and run a command like shutdown but I can't run a batch file.

What should I do?

try calling script from another drive. Drive C may have need admin permission to access.

SshCommand command = client.RunCommand("D:\mybatch.bat"); 

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