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

How can I use procomm to autorun a script everyday? 5

Status
Not open for further replies.

Beauty1982

Programmer
May 29, 2008
144
0
0
MX

Hi Folks!

I want to create an script that ask information from a CS1000 every day automatically, in other word, runs the script, save the file in my PC and in 24hrs do the same task.

How can I do it?

Thanks in advance for your help
 
I use the built in Windows 'Scheduled Tasks' you find it in the control panel.
 
Thanks kodr!
I was thinking about how to implement this task, can you give me some steps to follow in order to configure it?
Thanks in advance.
Because I'm stuck, using "Scheduled task" I only can open an application, but nothing more.
Please give me a hand.
 
You can specify a command line that launches your script, which should do all of the work. The format to use is:

<path to Procomm>\PROGRAMS\PW5.exe script.wax

 
Thanks a lot knob!

Do you have an script example about how to open a session download information, close the fole and save it changing the name everyday in order to don't overlap the information?

I'll be helpfull

Friendly regards

 
There are a few examples on the samples page of my site (link below) that will get you started. Also look for the example capture file/naming scripts. Sorry I can't point you to anything more specific, have to hit the door!

 
Thanks a lot knob again for your help, I'll check your site.

Regards and thanks
 
Hi B,
Re:- "a script example about how to open a session download information, close the fole and save it changing the name everyday in order to don't overlap the information?"

This script example opens a TELNET session to an entry called "Central TTY 7", logs in to the PABX, sets the capture file to "D:\file_dd_mm_yyyy.txt". The process example I used is a STAT in LD96. Note that when adding the DATE string to the filename string I added a line of code to strip out the "/" characters as they are invalid for a filename.

Code:
PROC MAIN
   WHEN USEREXIT call TERM					;ensure logoff occurs if user exits
   dial TELNET "Central TTY 7"					;connect to tty 7	
   
   while $DIALING						;necessary loop to pause script 
   endwhile
   
   if $CARRIER
  	 waitfor "#"						;this is the prompt our pabx presents to a TELNET session 
  	 mspause 250
  	 transmit "admin^M"					;our username			
	 transmit "^M"						;= ENTER Key
	 waitfor "TTY" 2					;the TTY prompt our pabx sends
   	 IF SUCCESS
       		;login to central
   		transmit "LOGI USER^M"				;USER LOGIN
   		waitfor "PASS?"
   		transmit "1234^M"				;PASSWORD
   		waitfor ">"
   			
   			call captcha	
   			call dothis	
   			call term  
	 ENDIF

   endif

ENDPROC  

PROC CAPTCHA
	WHEN USEREXIT call TERM					;ensure logoff occurs if user exits
	string capfile = "File_"	
	strcat capfile $DATE					;add the DATE to the filename
	strreplace capfile "/" "_"				;remove "/" chars as they are invalid for a filename
	strcat capfile ".txt"   				;denote it as a txt file 
	set capture path "D:\"					;Capture Directory/Path
	set capture file capfile    					
	set capture overwrite ON
	clear 								    
   	capture on                 	
ENDPROC

PROC DOTHIS
	WHEN USEREXIT call TERM					;ensure logoff occurs if user exits
	transmit "LD 96^M"					;replace this with your process
	waitfor "."
	transmit "STAT DCH^M"
	waitquiet 5 FOREVER
ENDPROC 
	 	
PROC TERM	 		
	capture off
	transmit "****" 					;log out of LD's
	waitfor ">"
	transmit "LOGO^M" 					;log out of PABX
	waitfor ">"
	disconnect
ENDPROC

Replace the TELNET/DIAL entry name, username & passwords with yours and this should see you well on the way.

Kodr's suggestion for "Scheduled Tasks" is my favoured method of running a script daily which was your initial question.

 
Hi comtechau!

I really appreciate your help, yo have been so kind sharing this information.

Friendly regards and happy day.

 
Hi comtechau:

I have 2 little issues, after the script has been run thru scheduler task, how can I close the procomm window???

And the second one, I need to insert this character ~ while doing my configuration in order to close the system, but according to ASPECT this is a reserved character, is there any change to use it?

Thanks in advance and have a good night.
 
You can add the pwexit command at the end of your script to close Procomm.

I assume you are including the ~ character in a transmit command? If so, add RAW to the end of the command to send the character through, like this:

transmit "string" RAW

 
I have a similar need to what Beauty1982 is doing so it was nice to see this today when I went searching. Thanks for the information knob and comtechau it appears to work perfectly for my situation.

However I am unable to start the script with a windows scheduled task. If I remove the script name from the end of the run box it launches procomm fine.

I am using version 4.7, would this make a difference?

 
I’m on the same boat, I can’t start the script in the task manager,
What is the proper way to start the script.
Here is the example from run C:\PROGRA~1\Symantec\PROCOM~1\PROGRAMS\PW5.EXE
 
That looks the same as what I had. Put it into a batch file like this.

cd \
cd \PROGRA~1\Symantec\PROCOM~1\PROGRAMS\
PW5.EXE <script name>.wax

exit *closes the cmd window when done.

Just type that into a notepad file and then save as a .bat file.
 
Thanks guycable2 the .bat file works great.
Here is the problem when I Compile script, any ideas ?

strreplace capfile "/" "_" ;remove "/" chars as they are invalid for a filename


Error C023 Line 28: Invalid expression token: CAPFILE
Error C163 Line 28: Invalid string variable
Error C022 Line 28: Missing token


strcat capfile ".txt" ;denote it as a txt file

Error C023 Line 29: Invalid expression token: CAPFILE
Error C163 Line 29: Invalid string variable
Error C022 Line 29: Missing token



set capture file capfile

Error C023 Line 31: Invalid expression token: CAPFILE
Error C166 Line 31: Invalid number or string
Error C165 Line 31: Invalid integer or string
 
I had the same issue.

I'm not a procomm expert by any means.

I have capture turned on automatically on all my address book entries so I took that part out. I would like to make it work but didn't have time to research.
 
The compile problem is that the string declaration of capfile is after an actual script command (the when userexit command at the beginning of the GOTCHA procedure). If you put the string capfile = "File_" at the beginning of the procedure, it will compile fine.

 
That's what I had and that did not work for me.

PROC CAPTCHA
WHEN USEREXIT call TERM ;ensure logoff occurs if user exits
string capfile = "File_"
strcat capfile $DATE ;add the DATE to the filename
strreplace capfile "/" "_" ;remove "/" chars as they are invalid for a filename
strcat capfile ".txt" ;denote it as a txt file
set capture path "D:\" ;Capture Directory/Path
set capture file capfile
set capture overwrite ON
clear
capture on
ENDPROC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top