Am trying to connect to Linux server using VBA shell command. Am not able to execute multiple commands in it.
I have the below code in my VBA script, and the command file which has the list of commands
Private Sub main_function()
cmd = "C:\putty.exe -t -ssh username@servername.com -pw password -P 22 -m c:\cmd.txt"
retval = Shell(cmd, vbMaximizedFocus)
End Sub
sudo to user
cat > filename.txt
sh shellfile.sh
I want to execute all the listed commands in the cmd.txt file but am not able to execute any command from the cmd.txt file, the code just logs in to the linux and exits.