MyFlight
Technical User
- Feb 4, 2002
- 193
Help,
I am trying to write a script file that will update passswords etc in a current dialing directory. I recently wrote a script for exporting with alot of help from KNOB attached below). This is what I am trying to
1. I need to change the passwords in the current directory.
2. Passwords are stored in Password and Misc.
3. I have the list of passowrdsa in a csv file.
In addition I am looking for a way to Import directories from csv files. The information contained in the CSV columns are (Note sometimes thse will change or be empty) followed by the variable to be used in the script file:
1. Directory Name - sDirectory
2. Site Name - sName
3. State - sState
4. Dial Type (only Data Num or Long Distance) - sDialType
5. Area Code - sAreaCode
6. Number - sPhoneNumber
7. Company Name - sCompany
8. User ID (Login) sUserId
9. Password - sPassword
10. Misc - sMisc
11. Country - sCountry
12. Teminal Type (usually IBM101 or ANSI BBS) - sTerminal
13. Capture File - sCapture
14. Script File - sScript
Since some of these Numbers are Tie-Line I use the Data Number only add have the Tie-Line access code incorporated into the PhoneNumber.
Most of the entries dialed are in the US, however I do have about 20 that are not in the United States.
If possible I would like to setup a message box that would prompt for the column number for the above items.
Does any suggestions? Any and all help will be greatly appreciated.
Here is the Directory Export script I currently have:
proc main
string szList, szItem, szNewItem
string fEnd = ".csv"
integer Event
szList = " IBM-BCRS Project-CBX.DIR, IBM-BCRS Project-PM.DIR, IBM-Lotus-CBX.DIR, IBM-Lotus-PM.DIR, IBM-Northern-CBX.DIR, IBM-Northern-PM.DIR, IBM-SouthCentral-CBX.DIR, IBM-SouthCentral-PM.DIR, IBM-StandAlone-PM.DIR, IBM-Western-CBX.DIR, IBM-Western-PM.DIR"
dialogbox 0 241 99 152 138 11 "Select The Directories you want Exported"
listbox 1 28 8 90 89 szList multiple szItem sort
pushbutton 2 54 114 40 14 "&OK" OK DEFAULT
enddialog
while 1
dlgevent 0 Event ; Get the dialog event.
switch Event ; Evaluate the event.
case 0 ; No event occurred.
endcase
case 1
endcase
case 2 ; Exit button selected
IF strsearch szItem "IBM-BCRS Project-CBX.DIR"
szNewItem = "IBM-BCRS Project-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-BCRS Project-PM.DIR"
szNewItem = "IBM-BCRS Project-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Lotus-CBX.DIR"
szNewItem = "IBM-Lotus-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Lotus-PM.DIR"
szNewItem = "IBM-Lotus-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Northern-CBX.DIR"
szNewItem = "IBM-Northern-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Northern-PM.DIR"
szNewItem = "IBM-Northern-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-SouthCentral-CBX.DIR"
szNewItem = "IBM-SouthCentral-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-SouthCentral-PM.DIR"
szNewItem = "IBM-SouthCentral-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-StandAlone-PM.DIR"
szNewItem = "IBM-StandAlone-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Western-CBX.DIR"
szNewItem = "IBM-Western-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Western-PM.DIR"
szNewItem = "IBM-Western-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
exitwhile
endcase
default ; Exit case chosen.
exitwhile ; Exit the loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
endproc
proc export
integer iEntries ;Number of entries in dialing class
integer iCount ;Loop variable
string sName ;Name of Connection Directory entry
string sAreaCode
string sCompany
string sPhoneNumber
string sUserID
string sPassword
string sMisc
string sComma = ","
string fEnd = ".csv"
string sEntry
string fName = $DDIRFNAME
dialcount DATA iEntries ;Get number of data entries
for iCount = 0 upto (iEntries - 1)
dialname DATA iCount sName ;Get name of entry based on index
set dialentry access DATA sName ;Turn on dialentry for the current entry
fetch dialentry areacode sAreaCode
fetch dialentry phonenumber sPhoneNumber
fetch dialentry company sCompany
fetch userid sUserID
fetch password sPassword
fetch misc sMisc
strcat sName sComma
strcat sAreaCode sComma
strcat sPhoneNumber sComma
strcat sCompany sComma
strcat sUserID sComma
strcat sPassword sComma
strcat sMisc sComma
strcat sEntry sName
strcat sEntry sAreaCode
strcat sEntry sPhoneNumber
strcat sEntry sCompany
strcat sEntry sUserID
strcat sEntry sPassword
strcat sEntry sMisc
fputs 1 sEntry
sEntry = ""
fclear 1
endfor
fclose 1
endproc
I am trying to write a script file that will update passswords etc in a current dialing directory. I recently wrote a script for exporting with alot of help from KNOB attached below). This is what I am trying to
1. I need to change the passwords in the current directory.
2. Passwords are stored in Password and Misc.
3. I have the list of passowrdsa in a csv file.
In addition I am looking for a way to Import directories from csv files. The information contained in the CSV columns are (Note sometimes thse will change or be empty) followed by the variable to be used in the script file:
1. Directory Name - sDirectory
2. Site Name - sName
3. State - sState
4. Dial Type (only Data Num or Long Distance) - sDialType
5. Area Code - sAreaCode
6. Number - sPhoneNumber
7. Company Name - sCompany
8. User ID (Login) sUserId
9. Password - sPassword
10. Misc - sMisc
11. Country - sCountry
12. Teminal Type (usually IBM101 or ANSI BBS) - sTerminal
13. Capture File - sCapture
14. Script File - sScript
Since some of these Numbers are Tie-Line I use the Data Number only add have the Tie-Line access code incorporated into the PhoneNumber.
Most of the entries dialed are in the US, however I do have about 20 that are not in the United States.
If possible I would like to setup a message box that would prompt for the column number for the above items.
Does any suggestions? Any and all help will be greatly appreciated.
Here is the Directory Export script I currently have:
proc main
string szList, szItem, szNewItem
string fEnd = ".csv"
integer Event
szList = " IBM-BCRS Project-CBX.DIR, IBM-BCRS Project-PM.DIR, IBM-Lotus-CBX.DIR, IBM-Lotus-PM.DIR, IBM-Northern-CBX.DIR, IBM-Northern-PM.DIR, IBM-SouthCentral-CBX.DIR, IBM-SouthCentral-PM.DIR, IBM-StandAlone-PM.DIR, IBM-Western-CBX.DIR, IBM-Western-PM.DIR"
dialogbox 0 241 99 152 138 11 "Select The Directories you want Exported"
listbox 1 28 8 90 89 szList multiple szItem sort
pushbutton 2 54 114 40 14 "&OK" OK DEFAULT
enddialog
while 1
dlgevent 0 Event ; Get the dialog event.
switch Event ; Evaluate the event.
case 0 ; No event occurred.
endcase
case 1
endcase
case 2 ; Exit button selected
IF strsearch szItem "IBM-BCRS Project-CBX.DIR"
szNewItem = "IBM-BCRS Project-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-BCRS Project-PM.DIR"
szNewItem = "IBM-BCRS Project-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Lotus-CBX.DIR"
szNewItem = "IBM-Lotus-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Lotus-PM.DIR"
szNewItem = "IBM-Lotus-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Northern-CBX.DIR"
szNewItem = "IBM-Northern-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Northern-PM.DIR"
szNewItem = "IBM-Northern-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-SouthCentral-CBX.DIR"
szNewItem = "IBM-SouthCentral-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-SouthCentral-PM.DIR"
szNewItem = "IBM-SouthCentral-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-StandAlone-PM.DIR"
szNewItem = "IBM-StandAlone-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Western-CBX.DIR"
szNewItem = "IBM-Western-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Western-PM.DIR"
szNewItem = "IBM-Western-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
exitwhile
endcase
default ; Exit case chosen.
exitwhile ; Exit the loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
endproc
proc export
integer iEntries ;Number of entries in dialing class
integer iCount ;Loop variable
string sName ;Name of Connection Directory entry
string sAreaCode
string sCompany
string sPhoneNumber
string sUserID
string sPassword
string sMisc
string sComma = ","
string fEnd = ".csv"
string sEntry
string fName = $DDIRFNAME
dialcount DATA iEntries ;Get number of data entries
for iCount = 0 upto (iEntries - 1)
dialname DATA iCount sName ;Get name of entry based on index
set dialentry access DATA sName ;Turn on dialentry for the current entry
fetch dialentry areacode sAreaCode
fetch dialentry phonenumber sPhoneNumber
fetch dialentry company sCompany
fetch userid sUserID
fetch password sPassword
fetch misc sMisc
strcat sName sComma
strcat sAreaCode sComma
strcat sPhoneNumber sComma
strcat sCompany sComma
strcat sUserID sComma
strcat sPassword sComma
strcat sMisc sComma
strcat sEntry sName
strcat sEntry sAreaCode
strcat sEntry sPhoneNumber
strcat sEntry sCompany
strcat sEntry sUserID
strcat sEntry sPassword
strcat sEntry sMisc
fputs 1 sEntry
sEntry = ""
fclear 1
endfor
fclose 1
endproc