Case background, a test server, intranet, no network,
All we need to do is to package the jar ourselves, upload the file to the server, and start the jar
The implementation process is relatively cumbersome and time-consuming, so the following script appeared
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd.exe"
WScript.Sleep 1500
WshShell.SendKeys "scp target\app.jar [email protected]:/home/services"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1500
WshShell.SendKeys "123456"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1500
WshShell.SendKeys "ssh [email protected] ""/home/services/start.sh restart"""
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1500
WshShell.SendKeys "123456"
WshShell.SendKeys "{ENTER}"