;PWHostsXfer.WAS v1.0
;*****************************************************************************
;* *
;* PWHostsXfer.WAS *
;* Copyright (C) 1998 Quarterdeck *
;* All rights reserved. *
;* *
;* Written by: Quarterdeck ASPECT Assist *
;* 12/19/97 *
;* *
;* This script file calls multiple locations and transfers/receives files. *
;* This script assumes that all the Hosts are running Procomm Plus Hosts and *
;* accept Remote ASPECT commands. The script also prints the Connection log. *
;* *
;*****************************************************************************
;*****************************************************************************
;* MACRO DEFINITIONS *
;*****************************************************************************
#DEFINE NUMBEROFCALLS 1 ;put number of places to call here
#DEFINE ENTRY1 "9,624-9727,,,,,,###5" ;holds first number
#DEFINE ENTRY2 "9,727-3199,,,,,,###5" ;holds second number
#DEFINE ENTRY3 "9,903-8224,,,,,,###5" ;holds third number
#DEFINE TIMEINTERVAL 1 ;can be 1 or 2 hours
;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************
string NumberToDial ;holds number to dial
string Passw, Pos, CapLog
integer Row=0, Col=1
long SystemVar, LinkVar
;*****************************************************************************
;* *
;* MAIN *
;* The Main procedure calls GetNumber to get the phone number to dial, calls *
;* PlaceCall to dial the number, calls Setmodem to set modem to 7,e,1, Calls *
;* Getpass to get the password from a Excel DB, calls RunReports to collect *
;* data from each system, call to CapLog to move data to report files *
;* *
;* Calls: GETNUMBER, PLACECALL, PERFORMCMDS, PRINTLOG *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
proc main
integer CurCall
for CurCall = 1 upto NumberOfCalls
GetNumber(CurCall) ;gets the current number to dial
PlaceCall() ;calls procedure to make calls
SetModem() ;SETS THE MODEM TO 7,E,1
GetPass() ;Gets password from Excel DB
CapLogFile() ;Moves collected data the reports file
RunReports() ;Collects the reports infromation
endfor
set autodnld ON ;this will reset setting set earlier
endproc
;*****************************************************************************
;* *
;* GETNUMBER(CURCALL) *
;* The procedure GetNumber determines the phone number to call. *
;* *
;* NOTE: This procedure will need to be modified to add numbers to call. *
;* This is done simply by adding an additional case statement. For *
;* example: case 4 *
;* NumberToDial = Entry4 *
;* endcase *
;* The Entry4 would need to be defined in the Macro section. *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************
proc GetNumber
param integer CurCall
switch CurCall ;retrieves the info on number to call
case 1 ;first number
NumberToDial = Entry1 ;set the number to dial
endcase
case 2 ;second number
NumberToDial = Entry2 ;set the number to dial
endcase
case 3 ;third number
NumberToDial = Entry3 ;set the number to dial
endcase
endswitch
endproc
;*****************************************************************************
;* *
;* PLACECALL() *
;* The procedure PlaceCall dials remote system and loops while dialing. *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NUMBERTODIAL *
;* *
;*****************************************************************************
proc PlaceCall
dialnumber DATA NumberToDial ;dials the number
while $DIALING ;loops while dialing
endwhile
endproc
;****************************************************************************
;* *
;* SetModem *
;* The procedure to set the modem to 7,e,1 *
;* *
;* Calls: None *
;* Called by: MAIN *
;* Modifies: Modem Settings *
;* *
;*****************************************************************************
proc SetModem
pause 1
SET PORT DATABITS 7
mspause 250
SET PORT PARITY EVEN
mspause 250
endproc
;*****************************************************************************
;* *
;* Getpass() *
;* The procedure Getpass performs a call to an Excel db for the password *
;* to loggon to the remote system. *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
proc Getpass
Clear
Row++ ; Increment the row
;************* Load Text File *****************************************
Waitfor "@PASSWORD:"
if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if not ddeinit LinkVar "excel" "sheet1" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet1"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos Passw ; Extract cell to Passw
strreplace Passw "`r`n" "" ; Remove C/R from Passw
Waitquiet 1
Transmit Passw
Transmit "^M"
ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
endproc
;*****************************************************************************
;* *
;* CapLogFile() *
;* This procedure will setup the capture file for all systems logged onto *
;* and place it into it's own file. *
;* *
;* Calls: ? *
;* Called by:MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
Proc CapLogFile
Clear
Set Capture Path "C:\Files"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
; Commented out the following as row has already
; been increment by GetPass procedure
; Row++ ;* Increment the row
;************* Load Text File *****************************************
if not ddeinit LinkVar "excel" "sheet2" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet2"
else
strfmt Pos "R%iC%i" Row Col ; Request cell to read
dderequest LinkVar Pos CapLog ; Extract cell to CapLog
ddeterminate LinkVar
ddeterminate SystemVar
strreplace CapLog "`r`n" "" ; Remove C/R from CapLog
Waitquiet 1
Set Capture File CapLog
capture on
Transmit "^M"
waitquiet 3
capture off
endif
endproc
;*****************************************************************************
;* *
;* RunReports() *
;* This procedure will run all the requested reports like but limited to *
;* List Features, Disk Report, Ports report Ect... *
;* *
;* Calls: NONE *
;* Called by: MAIN *
;* Modifies globals: NONE *
;* *
;*****************************************************************************
Proc RunReports
Transmit "l h^M"
Waitfor "@"
Transmit "l r 1^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@"
Transmit "l r 8^M"
Waitfor "ENTER DIGIT PATTERN. :"
Transmit "ALL^M"
Waitquiet 10
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@"
Transmit "l r 6^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@"
Transmit "l r 4^M"
Waitfor "ENTER DIGIT PATTERN. :"
Transmit "ALL^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@"
Transmit "l r 5^M"
Waitquiet 10
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@"
Transmit "l p^M"
Endproc