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!

Alphabetical Directory search question ?

Status
Not open for further replies.

chouck

MIS
Jan 30, 2005
32
US
Hi All,

this one is kind of complicated to me so i'll try to explain it the best i can. i have a text file of all users in my location. i want to use that text file as input to connect to there home directories and add a line to their logon script that will call an application setup when they logon.

i have about 1000 users and do not want to edit them all at one time, becuase i don't want 1000 people to install the app all at once.

what i was thinking about doing was using an input box for the first user to change through the last user i wanted to change. Then when those users had been upgraded go through the next section of users like for instance on day one go through users A - G, on day two go through users H - L, and so on.

here's what i have so far, i just don't know how to integrate the input boxes into what files get changed and which ones don't. any help is appreciated


option explicit


dim ofso, opc, oshell, owmisvc, ouserstart, ouserstop, ouserfile, ouser, ouserbat


opc = "."
set ofso = createobject("scripting.filesystemobject")
set oshell = createobject("wscript.shell")

const forreading = 1
const forappending = 8

set ouserfile = ofso_OpenTextFile("\\server\users\users.txt", forreading)
ouserstart = inputbox("Please enter the username of the first user's logon script to be edited", "Logon Script Change for app install")
ouserstop = inputbox("Please enter the username of the last user's logon script to be edited", "Logon Script Change for app install")
do until ouserfile.atendofstream
ouser = ouserfile.readline
wscript.echo ouser
set ouserbat = ofso.opentextfile("\\server\users\" & ouser & "\scripts\userbatchfile.bat", forappending)
ouserbat.writeline "\\Server\Appshare\app_call.vbs"
loop

ouserfile.close
 
A starting point:
do until ouserfile.atendofstream
ouser = ouserfile.readline
If ouser > ouserstop Then Exit Do
If ouser >= ouserstart Then
wscript.echo ouser
set ouserbat = ofso.opentextfile("\\server\users\" & ouser & "\scripts\userbatchfile.bat", forappending)
ouserbat.writeline "\\Server\Appshare\app_call.vbs"
End If
loop

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
as a matter of interest what advantage do you find from having each user have an individual logonscript in their homedirectory which will mean a dependancy to have homedrive available before the logonscript will run, or am i missing the point?
 
PHV,

that worked awesome. it did exactly like what i wanted it to. Thanks a million!!!

mr. movie,

that was just the way it has always been set up here. i guess in case a user needed something particular to just them or something like that.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top