@echo off rem ********************************************************************** rem * This batch file runs the correct PC Anywhere program switches rem * for PCAnywhere DOS Version 5.0 at the Activity and Version 5.0 at rem * the host. It automatically runs PCAnywhere and initiates the rem * the actdnld5.scx script which downloads a payroll file to the remote rem ********************************************************************** rem rem rem c:\aw50\aw /O:S /M:S /N:actdnld5Below is the actdnld5.scr script file that downloads a payroll file. Some overview: the host system is configured in PCAnywhere for DOS on the REMOTE as 'LCCS' and includes the telephone number, and the required pcanywhere login and passwords in it. The modem on the remote system is configured on COM2 and Hayes Compatible. The host system is also a Novell server, so Novell login is required. You can remove that portion to suit your needs. The script downloads a single file from the host to the remote and notifies the user if errors occur.
;************************************************************************ ; SYSTEM: Electronic Data Interchange Script ; AUTHOR: Tracy C. Holzer ; DATE: 26 JUNE 1995 ; LAST MODIFIED: 15 JULY 1998 ;************************************************************************ ; Variable Declaration string Login[79] ; String for HOST Novell Login string NOVELLPASS[79] ; String for HOST Novell PassWord string HostDrive[2] ; Download drive location on HOST string HostDownLoad[79] ; Download path location on HOST ;------------------- Parameters to Change -------------------------------- ; NOTE: All variables below MUST BE INCLOSED IN QUOTES EXCEPT THE PORTNUM ; variable -- it is NUMERIC and MUST BE WITHOUT QUOTES! ; **************** Login = "yourlogin" ; Replace with your Novell login on host NOVELLPASS = "yourpassword" ; Replace with your Novell password on host PortNum = 2 ; Replace with the Comm port your Modem uses HostDrive = "Y:" ; Replace with drive letter on host system drive ; ***************** ;========================================================================== ; MAIN ROUTINE ;========================================================================== @begin: ; Main dailup routine set attribute 44 clear screen ; begin with clear screen with attributes set attribute 37 set attribute 1 set echo off ; don't echo messages to screen clear screen LET $ERROR=0 ; Set error variable to no errors (0) LET $RESULT=0 ; Command result variable set to 0 set ignorecase on ; do not force uppercase letters on error goto @error ; error trapping routine set cancel on on cancel goto @cancel cursor position 5 33 set attribute 37 set attribute 1 set attribute 5 type string "Dailing host ..." ; send message to screen set disconnect on ; set disconnection trapping on on disconnect goto @DISCONNECT ; disconnection error trap set timeout 120 ; set timeout to 120 seconds Session ExitMode Accept ; leave pcAnywhere active to accept calls Session Overwrites Always ; will always overwrite file on download Session OnError Ignore ; at error will go to next line Session Timeout 120 ; timeout value Session Retry 3 ; number of retries Session Delay 2 ; amount of time between retries Session Dial LCCS ; intiates remote control session using LCCS configuration cursor position 5 28 ; this portion logs into Novell server and occurs AFTER successful pcanywhere ; to pcanywhere connection is achieved. type string "Logging into Novell..." ; send message to screen send scancode "" ; advances one line send scancode "" ; advances one line wait time 2 ; waits 2 seconds send scancode Login ; send login to host wait time 2 ; waits 2 seconds send scancode "^M" ; send a line return wait time 2 ; waits 2 seconds send scancode NOVELLPASS ; send password to host wait time 2 ; waits 2 seconds send scancode "^M" ; send a line return wait time 2 ; waits 2 seconds ; change to the correct location to download file FROM on the HOST send scancode "CD\LABOR\DOWNLOAD^M" ; changes to download directory wait time 3 ; waits 3 seconds ;************************************************************************************* ; The next line initiates the data transfer - from host to remote with paths included ;************************************************************************************* SessOpr Host Send "y:\labor\download\*.lzh c:\labor\download\" ; receive these files set disconnect off ; sets disconnect trap off GOTO @hangup ; goes to hangup subroutine ;************************************************************************ ; HANGUP ;************************************************************************ @HANGUP: LET $ERROR=0 ; reset error code to no error LET $RESULT=0 ; reset result code to okay set attribute 44 clear screen set attribute 37 set attribute 1 set attribute 5 cursor position 5 10 type string "Please be patient...Hanging up phone and logging off LCCS..." set disconnect off session end IF ($ERROR<0) GOTO @error ; an error occurred trying to logout and hangup EXIT ; return to exit normally ;************************************************************************ ; DISCONNECT OCCURS ;************************************************************************ @DISCONNECT: ; disconnection, so end the script set disconnect off ; stop disconnection trap set attribute 41 set attribute 1 clear screen set attribute 37 set attribute 1 CURSOR POSITION 5 25 Type string "ERROR! Disconnect Occurred!" goto @ERROR ;************************************************************************ ; USER PRESSED ESCAPE TO ABORT OR EXIT ;************************************************************************ @CANCEL: ; User exit cursor position 5 28 type string "User Pressed Escape!" GOTO @ERROR ;************************************************************************ ; ERROR OCCURRED ;************************************************************************ @ERROR: set disconnect off set attribute 41 set attribute 1 clear screen set attribute 37 set attribute 1 ON ERROR ; CANCEL ERROR TRAP-WE ARE HERE cursor position 6 25 IF ($ERROR==-8) THEN TYPE STRING " File not found." IF ($ERROR==-4) THEN TYPE STRING " Timeout has occurred." IF ($ERROR==-1) THEN TYPE STRING " User aborted script." IF ($ERROR==-19) THEN TYPE STRING " File already exists." IF ($ERROR==-15) THEN TYPE STRING "Could not establish a connection." BEEP ; AUDIBLE SOUND ALARM wait time 1 BEEP wait time 1 BEEP cursor position 2 31 type string "**** WARNING ****" cursor position 4 31 type string "AN ERROR OCCURRED!" cursor position 8 31 type string "ERROR NUMBER: " IF ($ERROR!=0) THEN type string $ERROR cursor position 10 31 type string "RESULT NUMBER: " IF ($RESULT!=0) THEN type string $RESULT cursor position 14 28 type string "Redial option in 10 seconds..." session end set attribute 44 clear screen set attribute 37 set attribute 1 LET $RESULT=0 LET $ERROR=0 MessageBox "MESSAGE BOX" "Do you want to dial the LCCS again?" 37 clear screen IF ($RESULT==4) Then Goto @begin goto @HANGUP ; User pressed escape error End of script with 1>>Did you ever resolve this issue completely? In the past, I wrote pcAnywhere scripts for the government and I have done both PcAnywhere for Dos 5.0 and PcAnywhere for windows scripts using Windows 95/98. Let me know if you are still having problems with the modem.