A small script to paste script / commands to SecureCRT
Very helpful if needed to paste alot of lines to network devices
With normal paste not all the characters paste if there are alot of lines
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# $language = "VBScript" # $interface = "1.0" option explicit Const ForReading = 1 Const ForWriting = 2 Sub Main Dim fso, file, str, file1, prompt1,new_subject,subject,result Dim ip_script, copy_ip_script_to_run_at_the_end, result2, auto_script copy_ip_script_to_run_at_the_end ="no" Set fso = CreateObject("Scripting.FileSystemObject") file1 = crt.Dialog.Prompt("Enter File Name to send","","D:script.txt") if file1 = "" then crt.Screen.Send "! ****** Script canceld by user ******"& Chr(13) exit sub end if prompt1 = crt.Dialog.Prompt("Enter the prompt of new line","",")#") if prompt1 = "" then crt.Screen.Send "! ****** Script canceld by user ******"& Chr(13) exit sub end if Set file = fso.OpenTextFile(file1 , ForReading, False) crt.Screen.Synchronous = True Do While file.AtEndOfStream <> True str = file.Readline ' crt.Dialog.MessageBox "ip_script="&ip_script if copy_ip_script_to_run_at_the_end ="no" then crt.Screen.Send str & Chr(13) crt.Screen.WaitForString prompt1 else ip_script=ip_script & str & chr(13) end if Loop if len(ip_script)>1 then crt.Screen.Send "! ****** sending ip configuration ******"& Chr(13) crt.Screen.Send ip_script end if crt.Dialog.MessageBox "Script endded" crt.Screen.Synchronous = False End Sub |
By: Sharon Saadon
highly interesting many thanks, there’s no doubt that your trusty followers may want even more reviews like this carry on the excellent work. mestreseo mestreseo mestreseo mestreseo mestreseo