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 12-05-2010, 11:27 AM
dean.spencer dean.spencer is offline
Registered User
 
Join Date: Oct 2010
Posts: 27
Script Header Issues

Hi, just wondering if there is a way I can convert my script.

I am currently using version 6.0.2 of CRT but my team using something like 5.5.

The problem is I have been building few scripts for eveyone to use, but only to find they get the msg "Invalid script header; $language not found"

I have included the script below, I save my files with the extension .vbs

==========================================

# $language = "VBScript"
# $interface = "1.0"

crt.Screen.Synchronous = True

Dim IPAddresses, IPArray, a

Sub Main

msgbox "This script will only work from one of these hop-off boxes (Crawley1 or Guildford1)"
'Ask User for IP Addresses
IPAddresses = crt.Dialog.Prompt("Enter IP Addresses or Radius ID:", _
"Enter Seperated by Comma", _
"")
IPArray = split(IPAddresses, ",")
For a = 0 to Ubound(IPArray)
crt.Screen.Send "netcommand -N " & chr(34) & "-atmdsl-" & chr(34) & " -c " & chr(34) & "sh users " & chr(124) & " i " & IPArray(a) & chr(34) & " -t 1" & Chr(13)

Next

End Sub

==========================================
Reply With Quote
  #2  
Old 12-06-2010, 09:26 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi dean.spencer,

Thanks for the information. I have run some tests with your script, and I cannot get the script to fail with the error you posted in SecureCRT 4.1.11 through to 5.5.4.

Would you confirm the version of SecureCRT that is being used?

What version of Windows is being used?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 12-06-2010, 11:20 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi dean.spencer,

After some additional research, it seems like this problem may be due to the format in which the script file is saved. If the SecureCRT version is older than 5.1.x, then it will be necessary to save the file in ANSI format. Otherwise, it should be possible to save the file in Unicode or UTF-8 format as long as the file is terminated in a CRLF.
__________________
--Todd

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 12:33 PM.