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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to AUTOMATE procomm

Status
Not open for further replies.

muralisai25

IS-IT--Management
Jul 20, 2002
51
US
I would like see an example of a script that would the following:
1) I need to automate the manual process of loggin in using Procomm and transmitting files via dial-up.

Note: I am using procomm to dial in to the host pc and transfer files. SO i need a script or a batch file in the client PC so when someone clicks on it..it will dial the host pc and transfer a file and close the connection autmatically.
Thankx for any help that i can get

 
I don't have any examples of what you are looking to do, but I can speak about the necessary commands a bit.

To dial the remote system, your script will need to use the dial command. This will require that you place an entry in your Connection Directory for the dial command to reference.

For logging on to the server and sending the commands to transfer the file, you'll need to use the transmit and waitfor commands. For this part of your script, I would recommend using the script recorder to generate the framework of your script. To do this, select the Tools | Scripts | Start Recorder menu item. Make your connection to the remote system and perform the needed steps. While you are doing this, the script recorder will be analyzing the text you send in response to the text that the remote system sent you. When you have completed the tasks, select the Tools | Scripts | Stop Recorder menu item. You will then be prompted to save your script to a file.

After you have done this, open your recorded script in the ASPECT Editor. You will see that the script is mostly composed of waitfor and transmit commands. However, you will not see a sendfile command in your script, which is needed to transmit the file to the other system. This is due to the script recorder only processing text-based commands. Here is how to handle the file transfer:

sendfile ZMODEM "filename"
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile

First, this will require that you define the integer variable iStatus in your script. The sendfile command as I've written it above will send your file using the Zmodem transfer protocol, so you may need to modify that argument. "filename" is the path and name of the file to transfer, and the double quotes are required. You would want to place the above block of code in your script just after the transmit command that tells the the remote system to prepare to receive the file. You can also do some error checking on on the iStatus variable after the while loop exits to determine if your file transfer was successful or not.

At the very end of your script, you would want to use either the exit or pwexit command. The exit command ends the execution of your script, while the pwexit command also closes Procomm.
 
If I might add to what Programmer already said. It sounded as though you might already have a script to do your connection but if you don't then you will have to write one. The second part is making Windows (actually DOS) execute your script. You will need a BAT or CMD file to do this. Below is an example of a BAT file that emails status reports to various addresses (it is a one line bat file):

C:\Progra~1\Symantec\Procom~1\PROGRAMS\pw5 sendday.was

Note the the use of the ~ in the path name. SOMETIMES the full path works sometimes it doesn't this always works (you can get the name from the the DIR /x command in DOS).

You can create the BAT file or create a windows shortcut either will work.

The script (sendday.was) already knows the addresses etc and the status file to send so it's just a matter of calling it with the BAT file.
 
Thank you guys.. I will try these two suggestions.
 
After having re-read your post. Do you HAVE a script ? If not, try using the
>Tools
>SCRIPTS
> Start recorder

This will allow you to capture your key strokes etc to get a good basis for your script. From there you can customize, enhance, protect the user quite well.

Also, what mode are you using ? (Data, telnet, ftp, etc)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top