I would like to rename a directory using wild card
Posted on 2011-05-04
I manage about 5000 Windows PCs and because our PR department insists on including graphic files in our outlook email signature, the outlook cache file gets full and the end users start seeing red x in place of the graphic. This is a known issue and the resolution is to empty the folder. On a windows xp machine, that directory is located at %userprofile%\local settings\temporary internet files\olkXXX where X is a random alpha/numeric. On a windows 7 box the directory is located at %userprofile\appdata\local\microsoft\windows\temporary internet files\olkXXX
What I thought I wanted to do is create batch or script that can be run via SCCM or at the least via a call from logon.bat that will del the contents of that directory at user logon. I have tried just doing a simple del command in batch and have had some limited success but because of some variables in our deployment I have reached the conclusion that what I really want to do is just delete the directory because Outlook will create a new one as needed. However, because the directory name will be different on every computer and in fact, different for every user on any given computer, it is somewhat problematic to identify the name via a batch.
I have some old experience with the command line but it has been some years and I think PushD and PopD may be useful but would like to hear from anyone that has already solved this problem.
Edited for more clerity.