新建批处理--buildLinux.cmd
新建VBScript文件--Linux.vbs
附录(SecureCRT帮助):
---------------------------------------------------------------------
del E:\dailybuilder\ftpTemp\linux
SecureCRT.EXE /s "192.168.0.2" /script "E:\dailybuilder\WebSite\Tools\Linux.vbs"
copy /Y E:\dailybuilder\ftpTemp\linux E:\dailybuilder\WebSite\buildFolder\
REM Taskkill /IM SecureCRT.EXE /T
---------------------------------------------------------------------
del E:\dailybuilder\ftpTemp\linux
SecureCRT.EXE /s "192.168.0.2" /script "E:\dailybuilder\WebSite\Tools\Linux.vbs"
copy /Y E:\dailybuilder\ftpTemp\linux E:\dailybuilder\WebSite\buildFolder\
REM Taskkill /IM SecureCRT.EXE /T
---------------------------------------------------------------------
新建VBScript文件--Linux.vbs
---------------------------------------------------------------------
#$language = "VBScript"
#$interface = "1.0"
Sub main
' turn on synchronous mode so we don't miss any data
crt.Screen.Synchronous = True
If (Not crt.Screen.WaitForString("username", 8)) Then
crt.Screen.Send vbCr
crt.Screen.WaitForString "username"
End If
crt.Screen.Send "cd /home/username/Coding" & VbCr
crt.Screen.WaitForString "Coding"
crt.Screen.Send "mk -c project.plf" & VbCr
crt.Screen.WaitForString "Coding"
crt.Screen.Send "cd /home/username/Coding/product/linuxd" & VbCr
crt.Screen.WaitForString "linuxd"
crt.Screen.Send "ftp 192.168.0.1" & VbCr
crt.Screen.WaitForString "Name "
crt.Screen.Send "ftpUser" & VbCr
crt.Screen.WaitForString "Password:"
crt.Screen.Send "ftpPassword" & VbCr
'crt.Screen.WaitForString "ftp>"
'crt.Screen.Send "delete jx_linux_t" & VbCr
crt.Screen.WaitForString "ftp>"
crt.Screen.Send "put linux" & VbCr
crt.Screen.WaitForString "ftp>"
crt.Screen.Send "quit" & VbCr
crt.Screen.WaitForString "linuxd"
crt.Screen.Send "exit" & VbCr
crt.Sleep 2000
' turn off synchronous mode to restore normal input processing
crt.Screen.Synchronous = False
crt.Sleep 2000
crt.Quit
End Sub
---------------------------------------------------------------------
#$language = "VBScript"
#$interface = "1.0"
Sub main
' turn on synchronous mode so we don't miss any data
crt.Screen.Synchronous = True
If (Not crt.Screen.WaitForString("username", 8)) Then
crt.Screen.Send vbCr
crt.Screen.WaitForString "username"
End If
crt.Screen.Send "cd /home/username/Coding" & VbCr
crt.Screen.WaitForString "Coding"
crt.Screen.Send "mk -c project.plf" & VbCr
crt.Screen.WaitForString "Coding"
crt.Screen.Send "cd /home/username/Coding/product/linuxd" & VbCr
crt.Screen.WaitForString "linuxd"
crt.Screen.Send "ftp 192.168.0.1" & VbCr
crt.Screen.WaitForString "Name "
crt.Screen.Send "ftpUser" & VbCr
crt.Screen.WaitForString "Password:"
crt.Screen.Send "ftpPassword" & VbCr
'crt.Screen.WaitForString "ftp>"
'crt.Screen.Send "delete jx_linux_t" & VbCr
crt.Screen.WaitForString "ftp>"
crt.Screen.Send "put linux" & VbCr
crt.Screen.WaitForString "ftp>"
crt.Screen.Send "quit" & VbCr
crt.Screen.WaitForString "linuxd"
crt.Screen.Send "exit" & VbCr
crt.Sleep 2000
' turn off synchronous mode to restore normal input processing
crt.Screen.Synchronous = False
crt.Sleep 2000
crt.Quit
End Sub
---------------------------------------------------------------------
附录(SecureCRT帮助):
Application Object Properties and Methods
Properties
Methods
ActivePrinter
GetTabCount
Dialog
GetTab
Screen
Sleep
Session
Quit
Version
Window
Properties
ActivePrinter
Description
Returns or sets the name of the active printer.
Syntax
crt.ActivePrinter [ = printerName ]
Remarks
Read/Write string property.
Example:
If crt.ActivePrinter "\\SERVER\InkJet2" Then
crt.ActivePrinter = "\\SERVER\InkJet2"
MsgBox "Updated Printer"
End If
Dialog
Description
Returns a reference to SecureCRT's Dialog object.
Syntax
Set object = crt.Dialog
Remarks
See the Dialog object documentation for a description of its properties and methods.
Screen
Description
Returns a reference to SecureCRT's Screen object.
Syntax
Set object = crt.Screen
Remarks
Object variables assigned from the screen property require the "Set" syntax. See the Screen object documentation for a description of its properties and methods.
Session
Description
Returns a reference to SecureCRT's Session object.
Syntax
Set object = crt.Session
Remarks
See the Session object documentation for a description of its properties and methods.
Version
Description
Returns a string containing SecureCRT's version.
Syntax
crt.Version
Remarks
Read-only string property
Example:
MsgBox "The version of SecureCRT is: " & crt.Version
Window
Description
Returns a reference to SecureCRT's Window object.
Syntax
Set object = crt.Window
Remarks
See the Window object documentation for a description of its properties and methods.
Methods
GetTabCount
Description
Returns the number of tabs.
Syntax
object = crt.GetTabCount
Remarks
None.
GetTab
Description
Returns the tab object of the specified index.
Syntax
Set object = crt.GetTab arg
Remarks
This does not bring the tab to the foreground.
Sleep
Description
Specifies the time (in milliseconds) to pause the script's execution
Syntax
crt.Sleep millisec
Remarks
The amount of time that it takes to execute the Sleep() method itself is a factor in how long the script pauses. Therefore, the accuracy of invoking Sleep with small values of 1 or 10 milliseconds will be affected by this overhead.
Example:
' Send a CR and pause for one second
crt.Screen.Send vbCr
crt.Sleep 1000
Quit
Description
Causes SecureCRT to exit.
Syntax
crt.Quit
Remarks
A script that invokes Quit will be terminated immediately and cause SecureCRT to exit.
Properties
Methods
ActivePrinter
GetTabCount
Dialog
GetTab
Screen
Sleep
Session
Quit
Version
Window
Properties
ActivePrinter
Description
Returns or sets the name of the active printer.
Syntax
crt.ActivePrinter [ = printerName ]
Remarks
Read/Write string property.
Example:
If crt.ActivePrinter "\\SERVER\InkJet2" Then
crt.ActivePrinter = "\\SERVER\InkJet2"
MsgBox "Updated Printer"
End If
Dialog
Description
Returns a reference to SecureCRT's Dialog object.
Syntax
Set object = crt.Dialog
Remarks
See the Dialog object documentation for a description of its properties and methods.
Screen
Description
Returns a reference to SecureCRT's Screen object.
Syntax
Set object = crt.Screen
Remarks
Object variables assigned from the screen property require the "Set" syntax. See the Screen object documentation for a description of its properties and methods.
Session
Description
Returns a reference to SecureCRT's Session object.
Syntax
Set object = crt.Session
Remarks
See the Session object documentation for a description of its properties and methods.
Version
Description
Returns a string containing SecureCRT's version.
Syntax
crt.Version
Remarks
Read-only string property
Example:
MsgBox "The version of SecureCRT is: " & crt.Version
Window
Description
Returns a reference to SecureCRT's Window object.
Syntax
Set object = crt.Window
Remarks
See the Window object documentation for a description of its properties and methods.
Methods
GetTabCount
Description
Returns the number of tabs.
Syntax
object = crt.GetTabCount
Remarks
None.
GetTab
Description
Returns the tab object of the specified index.
Syntax
Set object = crt.GetTab arg
Remarks
This does not bring the tab to the foreground.
Sleep
Description
Specifies the time (in milliseconds) to pause the script's execution
Syntax
crt.Sleep millisec
Remarks
The amount of time that it takes to execute the Sleep() method itself is a factor in how long the script pauses. Therefore, the accuracy of invoking Sleep with small values of 1 or 10 milliseconds will be affected by this overhead.
Example:
' Send a CR and pause for one second
crt.Screen.Send vbCr
crt.Sleep 1000
Quit
Description
Causes SecureCRT to exit.
Syntax
crt.Quit
Remarks
A script that invokes Quit will be terminated immediately and cause SecureCRT to exit.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决