Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-21-2018, 12:59 PM
dlong dlong is offline
Registered User
 
Join Date: Dec 2015
Posts: 8
Hourly or Daily Serial Report to Printer?

I am wondering how SecureCRT can be scripted so that an hourly or daily report on a serial connection can be sent to a default printer automatically.

In the Scripting Essentials guide, there's a reference to crt.screen.SendKeys("{PRTSC}") but nothing else on auto-printing.

I can capture data to a file with a variable name; is there then a command to print the file once it has been captured?

Any pointers appreciated.
Reply With Quote
  #2  
Old 05-21-2018, 02:21 PM
dlong dlong is offline
Registered User
 
Join Date: Dec 2015
Posts: 8
I found a good lead which seems to work:

Set objShell = CreateObject("WScript.Shell")
objshell.Run "Notepad /p " & strFileName
objshell.close
Reply With Quote
  #3  
Old 05-21-2018, 03:01 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 447
Hi dlong,

SecureCRT's scripting interface offers a way to select a printer and print.

To locate this information in SecureCRT's help file navigate to Contents > Scripting > Script Objects Reference. The Application object has a ActivePrinter property and the Session Object has the print method.

Code:
If crt.ActivePrinter <> "\\SERVER\InkJet2" Then
    crt.ActivePrinter = "\\SERVER\InkJet2"
    MsgBox "Updated Printer"
End If

crt.Session.Print
Does this help provide the functionality you're looking for? If you are wanting to print all data received we may also look at enabling auto printing.
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:10 PM.