Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've created a simple batch file that opens the host ESXi shell via ssh on putty and I'd like to execute commands in that shell from a file.

I've tried adding "-m commands.txt" to my batch file but the commands aren't run in my putty session and it causes it to close.

How can I run the batch file to open the putty session and run commands in the new putty session automatically?

Thanks

EDIT: This is the code I've tried running:

start cmd.exe "C:puttyShortcut.lnk" -m C:commands.sh

Note that the putty shortcut contains my host login information

-C:putty.exe -ssh user@host -pw password

commands.sh currently just looks like this while I focus on getting this to work

#!/bin/sh

vim-cmd vmsvc/getallvms

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
337 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...