MyFlight
Technical User
- Feb 4, 2002
- 193
I have a script I have written for accessing and running/downloading data in our switches. The porblem is I am calling it from another script and the capture function no longer seems to work. The way it is supposed to work is that the Data is written to certian file in the C:\Temp Data\Raw Data\Directory. However when I call this script from an master script all of the data is written to the capture file specified in the ProComm Directory. In addition the Correct file is written in the correct directory with NO DATA???? I have added variuos USERMSG's for troubleshooting, and they all display the correct information.
Anyone have any ideas?
string sAnalog = "Analog66.txt"
string sACSU = "Consoles66.txt"
string sATNDG = "ConsoleGrp66.txt"
string sDnit = "Dnit66.txt"
string sHunt = "Hunt66.txt"
string sBcsuStat = "BcsuStatus66.txt"
string sBcsuTble = "BcsuTable66.txt"
string sDigital = "Digital66.txt"
string sKasu = "Kasu66.txt"
string sKepro = "Kepro66.txt"
string sFwding = "Forwarding66.txt"
string sName = "Name66.txt"
string sPuGrp ="PickGroup66.txt"
string sRecorder ="Recorder66.txt"
string sRms = "Rms66.txt"
string sSbcsu = "Sbcsu66.txt"
string sSdDig ="SpeedDigits66.txt"
string sSdLst ="SpeedLists66.txt"
string sSubFeat = "SubFeat66.txt"
string sSwitchID = "SiteId66.txt"
string sTCSU = "TrkList66.txt"
string sTGACC = "TrkGrp66.txt"
string sAcctNum, s_Line
string NormalCap = "OldCapture.cap"
string CapPath ="C:\Temp Data Files\Raw Data\"
string OldCapPath ="C:\Program Files\Symantec\Procomm Plus\Capture"
Proc main
string CmrAnalog, CmrACSU, CmrATNDG, CmrBcsuStat, CmrBcsuTble, CmrDigital, CmrDnit, CmrHunt
string CmrKasu, CmrKepro, CmrFwding, CmrName, CmrPuGrp, CmrSdLst, CmrSdDig, CmrRecorder
string CmrRms, CmrSbcsu, CmrSubFeat, CmrSwitchID, CmrTCSU, CmrTGACC, sCompany, sUserID
string sPassword, sMisc
; this is were the sAcctNum is stored.
; it is a file with a 7 digit number only.
fopen 1 "C:\program files\symantec\procomm plus\capture\CMRFile.txt" READ TEXT
fgets 1 s_Line
strcpy sAcctNum s_Line
; These are the files where the data should be written!
usermsg "sAnalog is: %s" sAnalog
strfmt CmrAnalog "%s_%s" sAcctNum sAnalog
usermsg "CmrAnalog is: %s" CmrAnalog
strfmt CmrACSU "%s_%s" sAcctNum sACSU
strfmt CmrATNDG "%s_%s" sAcctNum sATNDG
strfmt CmrDnit "%s_%s" sAcctNum sDnit
strfmt CmrHunt "%s_%s" sAcctNum sHunt
strfmt CmrBcsuStat "%s_%s" sAcctNum sBcsuStat
strfmt CmrBcsuTble "%s_%s" sAcctNum sBcsuTble
strfmt CmrDigital "%s_%s" sAcctNum sDigital
strfmt CmrFwding "%s_%s" sAcctNum sFwding
strfmt CmrKasu "%s_%s" sAcctNum sKasu
strfmt CmrKepro "%s_%s" sAcctNum sKepro
strfmt CmrName "%s_%s" sAcctNum sName
strfmt CmrPuGrp "%s_%s" sAcctNum sPuGrp
strfmt CmrRecorder "%s_%s" sAcctNum sRecorder
strfmt CmrRms "%s_%s" sAcctNum sRms
strfmt CmrSbcsu "%s_%s" sAcctNum sSbcsu
strfmt CmrSdDig "%s_%s" sAcctNum sSdDig
strfmt CmrSdLst "%s_%s" sAcctNum sSdLst
strfmt CmrSwitchID "%s_%s" sAcctNum sSwitchID
strfmt CmrSubFeat "%s_%s" sAcctNum sSubFeat
strfmt CmrTCSU "%s_%s" sAcctNum sTCSU
strfmt CmrTGACC "%s_%s" sAcctNum sTGACC
; This script executes at the Direct Amo Prompt
capture OFF
pause 2
transmit "^M"
waitfor "# "
transmit "ufamos -d^M"
waitfor " <"
set capture path CapPath
usermsg "CapPath is: %s" CapPath
set capture file CmrSwitchID
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 3
transmit "DIS-DBC;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrACSU
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-ACSU;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrATNDG
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "DIS-ATNDG:;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrDnit
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-DNIT;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrHunt
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "DIS-HUNT:;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrRecorder
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-RCSU;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrSbcsu
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SBCSU;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrTGACC
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-TGACC;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrBcsuStat
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "DIS-BCSU:STAT,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrBcsuTble
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "DIS-BCSU:TBL,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrTCSU
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-TCSU:,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrRms
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-RMS;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrAnalog
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SCSU:ANATE,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrName
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-PERSI:STN,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrDigital
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SCSU:NONANATE,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrFwding
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-DEST:CFW,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrKasu
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-KASU;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrPuGrp
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-PUGRP:SYS;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrSdDig
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SDDIG:SYS;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrSdLst
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SDLST:SYS;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrKepro
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-KEPRO:ALL;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrSubFeat
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SUBFT;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 3
set capture path OldCapPath
set capture file NormalCap
set capture overwrite ON
set capture query OFF
transmit "^D"
waitfor "# "
transmit "exit^M"
waitfor "ATZ"
transmit "^M^M^M"
waitfor "login: "
hangup
capture OFF
endproc
Anyone have any ideas?
string sAnalog = "Analog66.txt"
string sACSU = "Consoles66.txt"
string sATNDG = "ConsoleGrp66.txt"
string sDnit = "Dnit66.txt"
string sHunt = "Hunt66.txt"
string sBcsuStat = "BcsuStatus66.txt"
string sBcsuTble = "BcsuTable66.txt"
string sDigital = "Digital66.txt"
string sKasu = "Kasu66.txt"
string sKepro = "Kepro66.txt"
string sFwding = "Forwarding66.txt"
string sName = "Name66.txt"
string sPuGrp ="PickGroup66.txt"
string sRecorder ="Recorder66.txt"
string sRms = "Rms66.txt"
string sSbcsu = "Sbcsu66.txt"
string sSdDig ="SpeedDigits66.txt"
string sSdLst ="SpeedLists66.txt"
string sSubFeat = "SubFeat66.txt"
string sSwitchID = "SiteId66.txt"
string sTCSU = "TrkList66.txt"
string sTGACC = "TrkGrp66.txt"
string sAcctNum, s_Line
string NormalCap = "OldCapture.cap"
string CapPath ="C:\Temp Data Files\Raw Data\"
string OldCapPath ="C:\Program Files\Symantec\Procomm Plus\Capture"
Proc main
string CmrAnalog, CmrACSU, CmrATNDG, CmrBcsuStat, CmrBcsuTble, CmrDigital, CmrDnit, CmrHunt
string CmrKasu, CmrKepro, CmrFwding, CmrName, CmrPuGrp, CmrSdLst, CmrSdDig, CmrRecorder
string CmrRms, CmrSbcsu, CmrSubFeat, CmrSwitchID, CmrTCSU, CmrTGACC, sCompany, sUserID
string sPassword, sMisc
; this is were the sAcctNum is stored.
; it is a file with a 7 digit number only.
fopen 1 "C:\program files\symantec\procomm plus\capture\CMRFile.txt" READ TEXT
fgets 1 s_Line
strcpy sAcctNum s_Line
; These are the files where the data should be written!
usermsg "sAnalog is: %s" sAnalog
strfmt CmrAnalog "%s_%s" sAcctNum sAnalog
usermsg "CmrAnalog is: %s" CmrAnalog
strfmt CmrACSU "%s_%s" sAcctNum sACSU
strfmt CmrATNDG "%s_%s" sAcctNum sATNDG
strfmt CmrDnit "%s_%s" sAcctNum sDnit
strfmt CmrHunt "%s_%s" sAcctNum sHunt
strfmt CmrBcsuStat "%s_%s" sAcctNum sBcsuStat
strfmt CmrBcsuTble "%s_%s" sAcctNum sBcsuTble
strfmt CmrDigital "%s_%s" sAcctNum sDigital
strfmt CmrFwding "%s_%s" sAcctNum sFwding
strfmt CmrKasu "%s_%s" sAcctNum sKasu
strfmt CmrKepro "%s_%s" sAcctNum sKepro
strfmt CmrName "%s_%s" sAcctNum sName
strfmt CmrPuGrp "%s_%s" sAcctNum sPuGrp
strfmt CmrRecorder "%s_%s" sAcctNum sRecorder
strfmt CmrRms "%s_%s" sAcctNum sRms
strfmt CmrSbcsu "%s_%s" sAcctNum sSbcsu
strfmt CmrSdDig "%s_%s" sAcctNum sSdDig
strfmt CmrSdLst "%s_%s" sAcctNum sSdLst
strfmt CmrSwitchID "%s_%s" sAcctNum sSwitchID
strfmt CmrSubFeat "%s_%s" sAcctNum sSubFeat
strfmt CmrTCSU "%s_%s" sAcctNum sTCSU
strfmt CmrTGACC "%s_%s" sAcctNum sTGACC
; This script executes at the Direct Amo Prompt
capture OFF
pause 2
transmit "^M"
waitfor "# "
transmit "ufamos -d^M"
waitfor " <"
set capture path CapPath
usermsg "CapPath is: %s" CapPath
set capture file CmrSwitchID
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 3
transmit "DIS-DBC;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrACSU
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-ACSU;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrATNDG
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "DIS-ATNDG:;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrDnit
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-DNIT;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrHunt
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "DIS-HUNT:;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrRecorder
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-RCSU;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrSbcsu
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SBCSU;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrTGACC
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-TGACC;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrBcsuStat
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "DIS-BCSU:STAT,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrBcsuTble
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "DIS-BCSU:TBL,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrTCSU
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-TCSU:,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrRms
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-RMS;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrAnalog
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SCSU:ANATE,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrName
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-PERSI:STN,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrDigital
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SCSU:NONANATE,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrFwding
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-DEST:CFW,;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrKasu
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-KASU;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrPuGrp
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-PUGRP:SYS;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrSdDig
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SDDIG:SYS;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrSdLst
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SDLST:SYS;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrKepro
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-KEPRO:ALL;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 5
set capture path CapPath
set capture file CmrSubFeat
set capture overwrite ON
set capture query OFF
capture ON
waitquiet 5
transmit "REGEN-SUBFT;^M"
waitfor " <" FOREVER
capture OFF
waitquiet 3
set capture path OldCapPath
set capture file NormalCap
set capture overwrite ON
set capture query OFF
transmit "^D"
waitfor "# "
transmit "exit^M"
waitfor "ATZ"
transmit "^M^M^M"
waitfor "login: "
hangup
capture OFF
endproc