Hi
I hope some one can help me with this. I have this script file to connect to a place, upload files and download files, but the download files I want them sent to specific folder. This is the script file:
#Define DownloadPath "f:\mp\download2"
#Define UploadPath "f:\mp\upload2"
proc main
integer iRetries = 5 ;Set number of redial attempts
integer iStatus ;Variable used for file transfers
integer iDay, iMonth, iYear, iHour, iMin, iSec
string sFileName
string sUpLoad = "f:\mp\upload2"
String sDownload = "f:\mp\download2" ;File to upload selected by user
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sFileName "%02d%02d%02d%02d" iMonth iDay iHour iSec
strcat sFileName ".997"
set terminal linewrap on
while 1
connectmanual DATA "xxxxxxxxxxx" ;Dial number
while $DIALING ;Pause while dialing
yield
endwhile
statmsg "%d" iRetries
if waitfor "+++" 5 ;If +++ string received
exitwhile
else
iRetries-- ;Decrement retries counter
if iRetries == 0 ;If five dial attempts have been attempted
errormsg "Could not establish connection - program aborting"
pwexit ;Close script and Procomm
endif
endif
endwhile
sendfile XMODEM "f:\mp\upload2\LOGON2"
iStatus = $XFERSTATUS
while iStatus == 1 ;Pause while transfer is ongoing
yield
iStatus = $XFERSTATUS
endwhile
if iStatus == 2 ;If transfer successful
;
elseif iStatus == 3 ;If transfer failed
errormsg "Could not send sign on - transmission aborting"
pwexit
endif
if isfile "f:\MP\upload2\OBTAIN.997" ;If SUBMIT file exists
sendfile XMODEM "f:\MP\upload2\OBTAIN.997"
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile
pause 5
chdir sDownload
getfile XMODEM "f\mp\download2\" sFileName
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile
if iStatus = 2
end()
else
errormsg "Could not receive file. - Transmission Aborting"
pwexit
endif
elseif iStatus == 3
errormsg "Could not send claim file medicare.emc - transmission aborting"
pwexit
endif
endproc
proc end
integer iStatus
integer iDay, iMonth, iYear, iHour, iMin, iSec
string sFileName
string sUpLoad = "f:\mp\upload2"
String sDownload = "f:\mp\download2" ;File to upload selected by user
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sFileName "%02d%02d%02d%02d" iMonth iDay iHour iSec
strcat sFileName ".MSG"
sendfile XMODEM "f:\MP\upload2\LOGOFF"
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile
pause 2
chdir sDownload
getfile XMODEM sFileName
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile
disconnect
pwexit
endproc
I hope some one can help me with this. I have this script file to connect to a place, upload files and download files, but the download files I want them sent to specific folder. This is the script file:
#Define DownloadPath "f:\mp\download2"
#Define UploadPath "f:\mp\upload2"
proc main
integer iRetries = 5 ;Set number of redial attempts
integer iStatus ;Variable used for file transfers
integer iDay, iMonth, iYear, iHour, iMin, iSec
string sFileName
string sUpLoad = "f:\mp\upload2"
String sDownload = "f:\mp\download2" ;File to upload selected by user
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sFileName "%02d%02d%02d%02d" iMonth iDay iHour iSec
strcat sFileName ".997"
set terminal linewrap on
while 1
connectmanual DATA "xxxxxxxxxxx" ;Dial number
while $DIALING ;Pause while dialing
yield
endwhile
statmsg "%d" iRetries
if waitfor "+++" 5 ;If +++ string received
exitwhile
else
iRetries-- ;Decrement retries counter
if iRetries == 0 ;If five dial attempts have been attempted
errormsg "Could not establish connection - program aborting"
pwexit ;Close script and Procomm
endif
endif
endwhile
sendfile XMODEM "f:\mp\upload2\LOGON2"
iStatus = $XFERSTATUS
while iStatus == 1 ;Pause while transfer is ongoing
yield
iStatus = $XFERSTATUS
endwhile
if iStatus == 2 ;If transfer successful
;
elseif iStatus == 3 ;If transfer failed
errormsg "Could not send sign on - transmission aborting"
pwexit
endif
if isfile "f:\MP\upload2\OBTAIN.997" ;If SUBMIT file exists
sendfile XMODEM "f:\MP\upload2\OBTAIN.997"
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile
pause 5
chdir sDownload
getfile XMODEM "f\mp\download2\" sFileName
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile
if iStatus = 2
end()
else
errormsg "Could not receive file. - Transmission Aborting"
pwexit
endif
elseif iStatus == 3
errormsg "Could not send claim file medicare.emc - transmission aborting"
pwexit
endif
endproc
proc end
integer iStatus
integer iDay, iMonth, iYear, iHour, iMin, iSec
string sFileName
string sUpLoad = "f:\mp\upload2"
String sDownload = "f:\mp\download2" ;File to upload selected by user
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sFileName "%02d%02d%02d%02d" iMonth iDay iHour iSec
strcat sFileName ".MSG"
sendfile XMODEM "f:\MP\upload2\LOGOFF"
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile
pause 2
chdir sDownload
getfile XMODEM sFileName
iStatus = $XFERSTATUS
while iStatus == 1
yield
iStatus = $XFERSTATUS
endwhile
disconnect
pwexit
endproc