I have a strong tendency to select the simplest solution for any given
problem. I know that this is a VB Scripting group but it seems that a batch
file solution would be much simpler than a VB Script file, e.g. like this
one:
[1] @echo on
[2] if exist "\\Server\Share\Folder\%UserName%.txt" goto :eof
[3] type "\\Server\Share\Folder\UserList.txt" | find /i "%Username%"
[4] if %ErrorLevel% GTR 0 (
[5] cd 2>"\\Server\Share\Folder\%UserName%.txt" & goto :eof
[6] ) else (
[7] dir /b "%UserProfile%\Desktop" >
"\\Server\Share\Folder\%UserName%.txt"
[8] )
Line 2 will ensure that that this section of the batch file runs just once,
regardless of which group the user belongs to.
Lines 3 and 4 will check if the current user belongs to your group of 120
users.
If the user does not belong to this group then Line 5 creates a zero-byte
semaphore file for the benefit of Line 2 at the next logon event.
Line 7 creates a directory listing of the current user's desktop. Again this
will be picked up by Line 2 at the next logon event. When it's all finished
and done then you can harvest your file lists from the various files on
your server share.
"Hemant" <Hemant@xxxxxx> wrote in message
news:71F745FE-90F1-4D94-8E76-4B959B13A09A@xxxxxx
> Hi Pegasus,
>
> My requirement is to get the list of files/folders on desktop of certain
> users. Out of 1100 users of a domain, I have to perform the search for 120
> users.
> I do have a script (say SEARCH.VBS -given in my last post) to get this
> information for locally logged on user. Only thing is user need to execute
> it
> in his login. I can call SEARCH.VBS in the existing login script (which
> runs
> at startup for all users), and get the output appended in a single file on
> shared folder. But in that case, SEARCH.VBS will run for all 1100 users
> and I
> will further need to identify and sort required data for 120 users within
> the
> file.
> Hence I am looking for a script which will get executed at startup for all
> users, but will perform the job of searching files/folders only for 120
> users. I do have list of these 120 users stored in text file on a shared
> folder. The script when executed at startup will compare the logged-on
> user
> with list of 120 users, if the user name matches, it will perform the
> search
> and store the result on shared folder by the name USERNAME.LOG.
>
> Hope, I have clarified my requirement.
>
> "Pegasus [MVP]" wrote:
>
>>
>> "Hemant" <Hemant@xxxxxx> wrote in message
>> news:CEB52746-8890-478A-9EF9-B2CC9B5B79F4@xxxxxx
>> > All users within domain are having common desktop (with some mandatory
>> > shortcuts/links copied through login script). I need to identify the
>> > contents
>> > (File/Folder names) on Desktops (%userprofile%\desktop) of few users
>> > (around
>> > 120) out of 1100 users. Following script outputs list of files/folders
>> > on
>> > desktop of a logged in user. I am planning to call this script in my
>> > existing
>> > login script with few modifications-
>> > 1. It will compare logged-on user with list of users stored on a shared
>> > folder
>> > 2. If the logged-on user name exists in the list, it will perform the
>> > operation of searching files on Desktop of logged-on user and output
>> > the
>> > list
>> > of files other than mandatory.
>> > 3. It will store the results in the shared folder with filename as
>> > USERNAME.LOG
>> >
>> > Script for searching files on Desktop of Logged on User-
>> > -------------------------------------
>> > Const DESKTOP = &H10&
>> >
>> > Set objShell = CreateObject("Shell.Application")
>> > Set objFolder = objShell.Namespace(DESKTOP)
>> > Set objFolderItem = objFolder.Self
>> > Wscript.Echo objFolderItem.Path
>> >
>> > Set colItems = objFolder.Items
>> > For Each objItem in colItems
>> > Wscript.Echo objItem.Name
>> > Next
>> > -------------------------------------
>> > Any help in this regards will be highly appreciated.
>> > Thanks..
>> > Hemant Sarmokadam
>> > >>
>> What is your specific question?
>>
>>
>>