Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strfmt, password changing script

Status
Not open for further replies.

oneraider

Technical User
Oct 13, 2003
4
US
I'm trying to automate password changes. I have a dialog that asks for the old password. CURPASS is the var. The system I send the command to is case sensitive. When I sent the command the CURPASS is in all caps.

string CURPASS = ""

dialogbox 0 7 17 288 63 2 "Password changer."
text 1 10 7 94 11 "Enter your current password." left
editbox 2 115 7 54 11 CURPASS MASKED
radiogroup 3 QUES
radiobutton 6 187 7 42 11 "Keep it?"
radiobutton 7 187 28 49 11 "Change it?"
radiobutton 8 238 7 42 11 "Forced?"
radiobutton 9 238 28 42 11 "Forced?"
endgroup
text 4 10 28 80 11 "Change password?" left
editbox 5 115 28 54 11 NEWPASS MASKED
pushbutton 10 187 42 40 13 "OK" OK DEFAULT
pushbutton 11 238 42 40 13 "Cancel" CANCEL
enddialog

strfmt s0 "CHG:pSSWD:OLD=`"%s`",NEW=`"t31c0v`";" CURPASS
transmit s0

I can add the full script if needed. I did see a command to change the string to all caps or to all lower. I just want to keep the case that the user enters.

 
What version of Procomm and what operating system are you running? I do not see this problem with version 4.8 on Win98. I took your script and modified it a little bit (just to get the dialog to display), then changed the transmit command to a usermsg command so it would display the command line. Here is the script I used:

proc main
string CURPASS = ""
integer QUES
string NEWPASS
integer iVar

dialogbox 0 7 17 288 63 2 "Password changer."
text 1 10 7 94 11 "Enter your current password." left
editbox 2 115 7 54 11 CURPASS MASKED
radiogroup 3 QUES
radiobutton 6 187 7 42 11 "Keep it?"
radiobutton 7 187 28 49 11 "Change it?"
radiobutton 8 238 7 42 11 "Forced?"
radiobutton 9 238 28 42 11 "Forced?"
endgroup
text 4 10 28 80 11 "Change password?" left
editbox 5 115 28 54 11 NEWPASS MASKED
pushbutton 10 187 42 40 13 "OK" OK DEFAULT
pushbutton 11 238 42 40 13 "Cancel" CANCEL
enddialog

while 1
dlgevent 0 iVar
switch iVar
case 10
exitwhile
endcase
endswitch
endwhile


strfmt s0 "CHG:pSSWD:OLD=`"%s`",NEW=`"%s`";" CURPASS NEWPASS

usermsg "%s" s0
endproc

aspect@aspectscripting.com
 
Thanks Knob, Some sleep and a fresh look revealed 2 lines that are part of my template:
";strupr CURPASS
;strupr NEWPASS"
Duh! I have to change alot of my commands to all caps and forgot about this being in the script. After I test the script I'll post it. It might only be useful to 5ESS techs and unix users that have to change passwds and prfer to keep their old one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top