replaceable parameters

  • Thread starter Thread starter Tian Liu
  • Start date Start date
T

Tian Liu

All of the temporary internet cache files generated by the terminal users
web surfing sessions are dumped on the file server. And I need to get a
cache size report/data.

A batch file like the following is fine, but I have to manually put in all
the user's home directory name, which is too much for a couple of hundred
users.

diruse /* /m "f:\homedir\user1\tsprofile\temporary internet
files\content.ie5" > e:\cachedata.txt
diruse /* /m "f:\homedir\user2\tsprofile\temporary internet
files\content.ie5" >> e:\cachedata.txt
diruse /* /m "f:\homedir\user3\tsprofile\temporary internet
files\content.ie5" >> e:\cachedata.txt

So the only variable here is the user1, user2, user3... Is there an easier
way to do this rather than put 200 lines in the batch file?

Thanks - Tian
 
You could use the FOR command with the /D switch, so it loops through each
subdirectory, something like this:

(Remove the line numbers, use them to identify unwanted line
wraps)

1. @Echo Off
2. Del e:\cachedata.txt
3. For /D %%V In (f:\homedir\*) Do (
4. DirUse.exe /* /m "%%V\tsprofile\temporary internet
files\content.ie5">>e:\cachedata.txt
5. )
 
Marty List said:
You could use the FOR command with the /D switch, so it loops through each
subdirectory, something like this:

(Remove the line numbers, use them to identify unwanted line
wraps)

1. @Echo Off
2. Del e:\cachedata.txt
3. For /D %%V In (f:\homedir\*) Do (
4. DirUse.exe /* /m "%%V\tsprofile\temporary internet
files\content.ie5">>e:\cachedata.txt
5. )

Thanks so much for the help. It has made the work a whole lot easier. But I
don't know what the */D* switch does.

- Tian
 
Back
Top