Jump to content

Recommended Posts

Posted

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

Posted

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!!!!

  • 1 month later...
Posted

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.

Posted

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.

Posted

@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

Posted

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)

Posted

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.

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...