1. Run Winscp
Sub RunSCP(cmdFile As String)
Dim exePath As String
exePath = "C:\Program Files (x86)\WinSCP\WinSCP.exe"
Dim cmd As String
cmd = """" & exePath & """ /console /log=winscp.log /script=" & cmdFile
Shell cmd, vbNormalFocus
End Sub
2. Run Tera Term
Sub RunTeraTerm(cmdFile As String)
Dim exePath As String
exePath = "
C:\Program Files (x86)\teraterm\ttpmacro.exe |
"
Dim cmd As String
cmd = """" & exePath & """ " & cmdFile
Shell cmd, vbNormalFocus
End Sub
3. Run Windows CMD bat
Sub RunBat(cmdFile As String, Optional parameters As Collection = Nothing)
Dim cmd As String
cmd = "CMD.EXE /c " & cmdFile
If Not parameters Is Nothing Then
Dim key
For Each key In parameters
cmd = cmd & " " & key
Next
End If
Shell cmd, vbNormalFocus
End Sub
Attention: Save the script files as UTF-8.
没有评论:
发表评论