BlackSheep Suspended 1575 Posts user info edit post |
I need to know how to write a script in either VBS or Jscript that will Telnet to an IP give login name when prompted give password when prompted then execute other commands
I'm planning to run this script with secure CRT. I've looked around and haven't been able to find much information.
Any help is appreciated. 2/28/2008 2:14:47 PM |
Scary Larry Suspended 644 Posts user info edit post |
I know this isn't what you asked, but expect was written for exactly this sort of thing. It's available for tcl, perl, most real scripting languages 2/28/2008 4:42:30 PM |
LimpyNuts All American 16859 Posts user info edit post |
If you don't know VB or JS it'll be a tough task. In VB you'll have to create a socket and connect using an implementation of TELNET that you will have to create. There's no "telnet" API that will do it for you. In fact, I don't remember what all the restrictions are on VB Script.
You don't have to worry about typing or initializing variables. I don't think it supports derived types (UDTs) or class objects, which will make your task really annoying. I don't know whether it supports controls (like the sockets control which would make your job a lot easier).
I'd write the code in a programming language and just call it from a script. 2/28/2008 5:21:47 PM |
DirtyMonkey All American 4269 Posts user info edit post |
i'm not sure that javascript or vbs is the way you want to go with this. maybe a java applet? 2/28/2008 5:37:07 PM |
Scary Larry Suspended 644 Posts user info edit post |
^^for most telnet servers, a raw TCP/IP socket will be adequate
however, as soon as you make that assumption, you'll find one that will not talk to you unless you send the control sequences defining your capabilities and acknowledging theirs
[Edited on February 28, 2008 at 5:56 PM. Reason : ^] 2/28/2008 5:55:46 PM |
qntmfred retired 40726 Posts user info edit post |
http://www.vandyke.com/support/crt/scripting_examples.html
def use jscript or vbscript. i've actually done securecrt scripting before, let me know if you have any problems
most of what has been said in this thread is irrelevant. they are thinking about connecting to telnet within a jscript or vbs script itself (with sockets and tcp/ip packets, etc). that's not what you do with securecrt. securecrt has an API to the UI, so you can let securecrt do what it does (connect to telnet sessions) and you just tell it what to type, essentially
[Edited on February 28, 2008 at 6:41 PM. Reason : .] 2/28/2008 6:34:13 PM |
BlackSheep Suspended 1575 Posts user info edit post |
Yeah, the secure CRT script is no problem. Basically, what I really want to do is automate a lot of the setup I have to do on telephone lines.
Basically I have to log into a switch, add certain features to certain lines based on which test case I'm doing.
What I really want is some sort of application to prompt me for the DN and then let me select the features. After that, I'd like the program to generate the script to go do it.
This may not be the best plan to do this. I'd appreciate suggestions or help.
Below is an outline for the larger application we'd like to develop. The plan is to turn this over to an intern this summer and fall. If any of you are interested please let me know. The interface has been developed in Visual J#. It is mainly an exercise in Access database retrieval and storage.
Level 1- Is the base application: Estimated Savings: Fewer Emails Users must login Provides a means to Broadcast Events and other information to all users Allows for the addition of new projects Projects may be custom Projects may be selected from ITT Database
Level 2- represents the normal processes that are required in order to set up/close out LEC or Interop Events: Estimated savings per project 5 Hr Start new Project Assign GWC Reserve DNs Provision DNs Select Test Plan Edit Test Plan: customize with the following items Add Customer Name Add DN provisioning Add GWC Provisioning Edit Status Sheet Add Customer Name Add DN assignments Setup 3rd Party Gateway- Must still be done manually Un-assign GWC Un-assign DNs PDF Final Test Report
Level 3- represents tasks that will be automated during the Testing Process: Estimated savings per project- 3-10 Hours
Assign and Change DN features based on a particular test case Change Profiles on GWC based on particular test cases Schedule changes on the GWCs so that other events are not impacted significantly Update Status sheets Add notes to Test Report Automatically mail status reports Track CRs
Level 4- represents the Time Tracking level. Tracks time for Levels 1-3: Estimated saves are 1-2 hr/week Project Readiness will be updated automatically based on the current process in Level 2 Hours will be deducted from those assigned in Level 2 based on the SC Code which is currently selected by the user Time lines will be created to track time of CRs and other events A Live view of project hours will be presented to the user Sharing of projects and Hours will be allowed User A can choose to assign 5 hours of his project to User B
Level 5- automates the re-assignment of projects from one user to another
Sharing of projects will be allowed User A can “pick up” User B’s project All current information user A has entered will be Saved Levels 2, 3 and 4 will be presented to the new user User A can “share” User B’s project Allows for users to work on the project simultaneously
[Edited on February 29, 2008 at 3:46 PM. Reason : additional info] 2/29/2008 3:40:37 PM |
qntmfred retired 40726 Posts user info edit post |
Quote : | "the program to generate the script to go do it. " |
i think you got the right idea. you can make a much more powerful and user friendly interface in visual j# and have the j# generate the jscript/perl/whatever that manipulates the secure crt session.2/29/2008 4:50:35 PM |