Thanks for checking on me. I have been able to get the information from the spreadsheet however it's not getting incremented correctly. The script does display the correct number to dial and does dial it correctly however when the second number comes up the script will also dial it correctly but the sheet 2 and sheet 3 have not been moved correctly so it issues an incorrect password, The script also doesn't seem to run back through the main I think, If you have the time you could look at this Ive treid the Row ++ everywhere I can think of with little succsess. Thanks for the help I'm almost there!!
;*****************************************************************************
;* *
;* 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 100
;*****************************************************************************
;* 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() ;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
set autodnld ON ;this will reset setting set earlier
Endfor
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
Clear
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 NumberToDial ; Extract cell to NumberToDial
strreplace NumberToDial "`r`n" "" ; Remove C/R from NumberToDial
Ddeterminate LinkVar
endif
else
errormsg "Couldn't establish DDE link to Excel!"
halt
endif
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
Waitfor "@PASSWORD:"
if ddeinit SystemVar "excel" "system" ; Initialize link to Excel
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
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 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
Set Capture Path "C:\ReportFiles"
Set Capture Overwrite OFF ;* Don't Overwrite
Set Capture Query OFF ;* Don't Prompt for Capture Query
if not ddeinit LinkVar "excel" "sheet3" ; Set up link to spreadsheet.
errormsg "Couldn't establish DDE link to spreadsheet sheet3"
else
Row ++
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 1
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"
Waitquiet 1
Transmit "ALL^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@" forever
Transmit "l r 6^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@"
Transmit "l r 4^M"
Waitquiet 1
Transmit "ALL^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@" Forever
Transmit "l r 5^M"
Waitfor "READY PRINTER, THEN PRESS RETURN..."
Transmit "^M"
Waitfor "@" Forever
Transmit "l p^M"
Waitquiet 1
Transmit "^M^M^M"
Waitquiet 1
Endproc