Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a string variable from a child script back to the parent

Status
Not open for further replies.

matt1981m

Technical User
Jul 1, 2006
32
US
I originally posted this question in a previous thread (thread448-1301392), and I got the answer I needed at that time. I then expanded my use of child scripts to involve a "password script" (thread448-1317148) used for logging into around 50 Nortel and Lucent switches via telnet, and now I am in need of assistance... again...

I currently use s0-s9 to pass variables from one script to another. I start off with a switch login script. That script opens a script that has the username and password needed to access the terminal, and passes that string back to the original script. I use the "password" script because when I change my password, I dont want to change 50+ switch scripts with the new password. I am lazy like that...lol

I am now in the process of migrating my voicemail (Glenayre and Comverse) scripts away from having the username and password loaded in the same script, and over to the same style of script I use for accessing the Nortel and Lucent MTSO's. The only problem is that I utilize more than the available number of username/password combinations (5 since I need 2 string variables per system, and they don't all use the same username/password like the MTSO's)

To make the the problem at hand a little more complex, if that was even possible, is that I also use a "change password" script that will load a dialog box and will change the designated variables (username and/or password, if desired) in the current password script to the new username and/or password. I also will be distributing all of my scripts to about 60-100 people who will need to enter their own username and password, so I have created a "new user" script that will insert their username and password where needed. What I need to know is, how can I have the ability to pass any combination of around 100 different strings all stored in the same child script to the parent script????
 
Not being real familiar with your scripts, I don't know if this will work but is an idea. Is each username/password combination associated with a particular Connection Directory entry, telnet IP, etc.? If so, could you modify your password script to accept the name of the system you want to connect to in s0, and then return the appropriate username and password in s1 and s2? Doing this would keep you from having to hardcode a specific username in one global system variable and a password in another if I understand what you are doing properly (but it's late and I should probably go to bed).

If you don't think that will work, then another way to solve the problem would be to have your parent script run the password script via command line and not the execute command, then use DDE to pass that information back to the main script. I have an example or two on the samples page of my site that shows how to command one session of Procomm from another using DDE.

 
Happened to jump to the site for another script, here is the link you want:


Here's the text about the script:

Here is one final example illustrating DDE operations. The script launches a second instance of Procomm Plus, which the first instance then makes a DDE connection with and requests the second instance run the hints script. This script was slightly modified from the script located in this technical bulletin. If you have further interest in this topic, I recommend reading item nine of this file. Please note that this script will only work with version 4.8 due to the the DDE server name changing from PW4 to PW5 with version 4.8.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top