chris23426
Technical User
I need help to send a file. This file name changes each time, so I need to be able to just send any filename in that "c:\micsdata\send" directory. The file will always end in .zip. After the file is sent I need it deleted from the c:\micsdata\send directory and moved to the c:\micsdata\sent directory. Here is the script I have so far.
;*****************************************************************************
;* MACRO definitions *
;*****************************************************************************
#define PhoneNum "17578243893" ;Phone Number to dial.
#define LoginID "unit1" ;Login Name.
#define Password "sampson" ;Login Password.
#define MicsFile "C:\MicsData\Send\*.zip" ;File to upload.
;****************************************************************************
;* Main *
;****************************************************************************
proc main
dialnumber DATA PhoneNum ;Dial the specified phone number.
while $dialing ;While dialing the number yield.
endwhile
if !$CARRIER
usermsg "Unable to connect to Mics server. Please try again later."
exit ;exits the script file
endif
waitfor "FULL Name:" ;Waitfor login name prompt.
if FAILURE
usermsg "Login prompt not received. Try again."
hangup ;hangs up the phone line
pause 2 ;waits two seconds
exit ;exits the script file
else
transmit LoginID ;Transmit the login name.
transmit "^M" ;Transmit a CR.
endif
waitfor "correct (Y/N)?"
transmit "Y"
waitfor "Password:"
if FAILURE
usermsg "Password prompt not received. Try again."
hangup ;hangs up the phone line
pause 2 ;waits two seconds
exit ;exits the script file
else
transmit Password
transmit "^M"
endif
waitfor "Choice?"
transmit "U" ;Select Upload Menu.
waitfor "choice?"
transmit "Z" ;Select ZMODEM protocol.
waitfor "name?"
transmit "Data.zip" ;Transmit the file name to upload.
transmit "^M"
waitfor "procedure..."
pause 1
if isfile MicsFile ;Check to see if the file exists.
sendfile ZMODEM MicsFile ;Send the file with ZMODEM.
while $xferstatus ;Pause script while transferring file.
yield
endwhile
endif
delfile MicsFile
pause 1
transmit "G" ;Select goodbye.
hangup ;Hangup the phone line.
clear ;Clear the terminal window.
pause 2
pwexit ;Close Procomm Plus.
endproc
;*****************************************************************************
;* MACRO definitions *
;*****************************************************************************
#define PhoneNum "17578243893" ;Phone Number to dial.
#define LoginID "unit1" ;Login Name.
#define Password "sampson" ;Login Password.
#define MicsFile "C:\MicsData\Send\*.zip" ;File to upload.
;****************************************************************************
;* Main *
;****************************************************************************
proc main
dialnumber DATA PhoneNum ;Dial the specified phone number.
while $dialing ;While dialing the number yield.
endwhile
if !$CARRIER
usermsg "Unable to connect to Mics server. Please try again later."
exit ;exits the script file
endif
waitfor "FULL Name:" ;Waitfor login name prompt.
if FAILURE
usermsg "Login prompt not received. Try again."
hangup ;hangs up the phone line
pause 2 ;waits two seconds
exit ;exits the script file
else
transmit LoginID ;Transmit the login name.
transmit "^M" ;Transmit a CR.
endif
waitfor "correct (Y/N)?"
transmit "Y"
waitfor "Password:"
if FAILURE
usermsg "Password prompt not received. Try again."
hangup ;hangs up the phone line
pause 2 ;waits two seconds
exit ;exits the script file
else
transmit Password
transmit "^M"
endif
waitfor "Choice?"
transmit "U" ;Select Upload Menu.
waitfor "choice?"
transmit "Z" ;Select ZMODEM protocol.
waitfor "name?"
transmit "Data.zip" ;Transmit the file name to upload.
transmit "^M"
waitfor "procedure..."
pause 1
if isfile MicsFile ;Check to see if the file exists.
sendfile ZMODEM MicsFile ;Send the file with ZMODEM.
while $xferstatus ;Pause script while transferring file.
yield
endwhile
endif
delfile MicsFile
pause 1
transmit "G" ;Select goodbye.
hangup ;Hangup the phone line.
clear ;Clear the terminal window.
pause 2
pwexit ;Close Procomm Plus.
endproc