replaceable parameters

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
 
M

Marty List

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. )
 
T

Tian Liu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top