browolf Posted July 19, 2005 Posted July 19, 2005 for the newyear 7 i have a csv file, but this year it has nothing in i want to use as passwords. i made a vbscript to append paswords onto the file but it doesnt work properly. i mean it works but the output isnt right. only the first two items in each array are used in generating the password. what have i done wrong? wordbank1 = Array("red","green","blue","yellow","pink","orange","purple","blue","black","white","angry","scary","sporty","posh","lazy","big","crazy","dizzy","dull","funny","great","gigantic","jolly","kind","mighty","new","nice","odd","quaint","quick","rare","roasted","round","sad","short","silly","strange","tricky","tough","wonderful","zany","striped","itchy") wordbank2= Array("elephant","donkey","wolf","rabbit","rat","hamster","mouse","cat","dog","sparrow","magpie","alligator","bison","condor","fox","eagle","swan","duck","owl","snake","hedgehog","kinkajou","bear","shark","llama","frog","lemur","hawk","tiger","lion","boar") Const ForReading = 1, ForWriting = 2 inputfile="2005admissions.csv" Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.OpenTextFile(inputfile, ForReading) Do While MyFile.AtEndOfStream <> True retstring = MyFile.ReadLine password = wordbank1(rnd(ubound(wordbank1))) & wordbank2(rnd(ubound(wordbank2))) wscript.echo retstring & "," & password Loop MyFile.Close
ChrisH Posted July 19, 2005 Posted July 19, 2005 At a quick glimpse I think you need to use the lbound and ubound functions to read completely through an array. eg For i = LBound(ArrBadStudents) to UBound(ArrBadStudents) A word of advice to all when generating passwords, do not use the date of birth!!!! I used the first two digits and initials last year only to find if a certain form hadnt been returned then they are made up and are wrong in SIMS!!!!
tosca925 Posted August 21, 2005 Posted August 21, 2005 I got stung last year as well. We used dates of birth from Sims and then found the admin staff had made up over 80 DOB just to get them on the system before they broke up for the summer holidays. We just generated random numbers in our .csv file in excell this year.
GrumbleDook Posted August 21, 2005 Posted August 21, 2005 We use a standard password for all new year 7's but we are running an extra induction day for them this year ... on 31st August when they will have the ICT Induction and the ICT Teachers will talk them through logging on, changing passwords, access email, saving work etc. The accounts of those students that attend will only be enabled after a register is read.
tarquel Posted August 22, 2005 Posted August 22, 2005 @GrumbleDook: Same here with the standard initial password for new first year - also is the same to new student users too. They then *have* to change it during the first logon Works fine on the XP machines but the 98 pc's seem to either do the process or fail on that process. Used to work fine with the NT 4 Server & 98 PC setup, but not now with the 2003 server. Still, not too bigger problem really - theres now plenty of xp pc's to do it on lol Regards, Nath
ajbritton Posted August 22, 2005 Posted August 22, 2005 Browolf, You are using the RND function incorrecty (check the MS reference for details). Basically, to generate a random number between X and Y, RandomNumber = INT(((Y-X) * RND) + X + 0.5) You should also initialise the random number generator at the beginning of your code with the RANDOMIZE statement. This will use the system timer as a seed. So, try the following to replace your 'password =...' line Rnd1 = int(((ubound(wordbank1)-lbound(wordbank1)) * rnd) + lbound(wordbank1) + 0.5) Rnd2 = int(((ubound(wordbank2)-lbound(wordbank2)) * rnd) + lbound(wordbank2) + 0.5) password = wordbank1(Rnd1) & wordbank2(Rnd2)
browolf Posted August 26, 2005 Author Posted August 26, 2005 thx. got it working using password = wordbank1(cint(ubound(wordbank1) * rnd)) & wordbank2(cint(ubound(wordbank2) * rnd)) although having created userareas an IT teacher thinks year 7 may have difficulty spelling such long passwords. apparently its common for them not to know there are 52 weeks in a year. oh dear! one slight problem I had that i'm pretty sure wasnt a problem last year. i've added the userareas as \\server\share$\username. this is the format i've used when manually adding users throughtout the year and win2k maps straight to the last folder. when i've tried these automatic created users users it doesnt do that for no apparent reason their userarea maps to \\server\share$ instead.
Dos_Box Posted August 26, 2005 Posted August 26, 2005 Have you created a default user for each group (teacher, pupils, admin etc)? Once created you simply insert the following line into home folder path \\servername\users\%username% the username variable will then automatically create a username with their folder and correct permissions.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now