SecureCRT Icon  CommandWindow Object


 

Description

Provides access to the Command window.

 

Syntax

crt.CommandWindow.Property [ = expression ]

crt.CommandWindow.Method([arglist])

 

Remarks

None.

 

CommandWindow Object Properties and Methods

Properties

Methods

    SendCharactersImmediately

    Send

    SendToAllSessons

 

    Text

    

    Visible

    

 

Properties

 

SendCharactersImmediately

Description

Returns or sets a Boolean value indicating whether Command window input should be sent immediately.

VBScript

Syntax

crt.CommandWindow.SendCharactersImmediately [ = True | False ]

Example

' Enable Send Commands to All Sessions

crt.CommandWindow.SendCharactersImmediately = True

Python

Syntax

crt.CommandWindow.SendCharactersImmediately [ = True | False ]

 

SendToAllSessions

Description

Returns or sets a Boolean value indicating whether Command window text should be sent to all sessions.

VBScript

Syntax

crt.CommandWindow.SendToAllSessions [ = True | False ]

Example

' Enable Send Commands to All Sessions

crt.CommandWindow.SendToAllSessions = True

Python

Syntax

crt.CommandWindow.SendToAllSessions [ = True | False ]

 

Text

Description

Returns or sets the text in the Command window.

Remarks

Read/Write string property. Multiple lines can be added to the Command window by CRLF.

VBScript

Syntax

crt.CommandWindow.Text [ = text ]

Example

' Populate the Command window with control character combined with visible character

crt.CommandWindow.Text = chr(27) & ":q"

 

' Get text currently in the Command window

strText = crt.CommandWindow.Text

 

' Populate Command window with multiple lines

crt.CommandWindow.Text = "ls -l" & vbcrlf & "pwd" & vbcrlf & "whoami"

Python

Syntax

crt.CommandWindow.Text [ = text ]  

Example

crt.CommandWindow.Text = "ls -l\r\npwd\r\nwhoami"

 

Visible

Description

Returns or sets a Boolean value indicating whether the Command window is visible.

VBScript

Syntax

object = crt.CommandWindow.Visible

crt.CommandWindow.Visible = [ True | False ]

Example

' Capture current visibility/state of the Command window

bCommandWindowVisible = crt.CommandWindow.Visible

' Make sure Command window is visible

crt.CommandWindow.Visible = True

' ... do other work...

' Restore Command window's state

crt.CommandWindow.Visible = bCommandWindowVisible

Python

Syntax

object = crt.CommandWindow.Visible

crt.CommandWindow.Visible = [ True | False ]

Example

# Capture current visibility/state of the Command window

bCommandWindowVisible = crt.CommandWindow.Visible

# Make sure Command window is visible

crt.CommandWindow.Visible = True

# ... do other work...

# Restore Command window's state

crt.CommandWindow.Visible = bCommandWindowVisible

 

Methods

Send

Description

Sends the current text in the Command window to the remote machine.

VBScript

Syntax

crt.CommandWindow.Send

Python

Syntax

crt.CommandWindow.Send()