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 strongm 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
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 got it to work partially by making this script like this, the only problem that I have file is blank when I open.

PROC CAPTCHA

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
 
I finally got it to work, here’s the script that automatically connects to the PBX and adjusts the time.

PROC MAIN

dial data "TIME_Ad" ;connect to tty 0

while $DIALING ;necessary loop to pause script
endwhile


pause 2
transmit "xxxxx" ;this is SEB password
waitfor "Ok, You are now transparent to port 1^M"
transmit "logi admin2^M" ;this is admin2 user name
waitfor "PASS?"
transmit "xxxxx" ;this is where you enter password

call captcha
call dothis
call term



ENDPROC


PROC CAPTCHA

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 "TIME.txt" ;denote it as a txt file
set capture path "C:\" ;Capture Directory/Path
set capture file capfile
set capture overwrite ON
clear
capture on
ENDPROC




PROC DOTHIS
integer iDay, iMonth, iYear, iMin, iHour, iSec, TimeDelta
string DMYHMS
TimeDelta=6 ; Approx delay in script....

set txpace 75
Transmit "****^M"
waitfor ">"
transmit "LD 2^M"
waitfor "."
termwrites "System time before adjusting:`n`r"
pause 2
transmit "TTAD^M"
waitfor "."

; Calculate date and time string.
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec

; Adjust for delay in script.
iSec=iSEc+TimeDelta
if iSec>60 ; Seconds must not be greater that 60.
iSec=iSec-60
iMin=iMin+1
if iMin>60 ; Minutes must not be greater that 60.
iMin=iMin-60
iHour=iHour+1
endif
endif

; Put the parts together.
strfmt DMYHMS "STAD %02d %02d %d %02d %02d %02d^M" iDay iMonth iYear iHour iMin iSec

; and send it to the switch
transmit DMYHMS
waitfor "."
pause 6
termwrites "System time after adjusting:`n`r"
pause 1
transmit "TTAD^M"
waitfor "."
pause 1
termwrites "This is the current DST settings: `n`r"
pause 1
transmit "TDST^M"
waitfor "."
pause 1
transmit "****^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
pwexit
ENDPROC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top