Re: Delete all files in certain folders across multiple users




"Rhenestofel" <rhenestofel@xxxxxxxxx> wrote in message
news:433b1c80-962e-4e96-b623-ecfb43607ecd@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hey,

I am fairly new at this and trying to create a script that will delete
all files out of a folder in a users account for instance the cookies:


Something like this
------

Const DeleteReadOnly = True

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile ("C:\Documents and Settings\(ALL ACCOUNTS ON THE
SYSTEM)\Cookies\*.*"), DeleteReadOnly

------
only i want it to go through multiple folders in the same manner

here is the list of folders
C:\Documents and Settings\%user name%\Cookies\*.*
C:\Documents and Settings\%user name%\Local Settings\History
\History.IE5\*.*
C:\Documents and Settings\%user name%\Local Settings\Temp\*.*
C:\Documents and Settings\%user name%\Local Settings\Temporary
Internet Files\*.*
C:\Documents and Settings\%user name%\UserData\*.*


Any help would be greatly appriciated.

Rich

Seeing that you wish to delete all files in the UserData folder,
why not delete the parent %UserName% folder? It would
simplify your job considerably!

You also need to state if you want to delete the files in
the nominated ***folders*** or in the ***folder trees***.

Lastly: If you want to use this as an exercise in VB scripting,
fine. If you just want a tool to do the job then a batch file
would require far fewer lines of code, largely because can
use commands with inbuilt recursive facilities. With VB
Scripting you have to design them yourself.


.



Relevant Pages

  • Re: FSO.MoveFile
    ... I'll look into the scripting guy's page-- thank you. ... I've already created the errorfiles' folder, ... I've never tested from a Workbook when the code was running from within the ... In the line where you remove the extension from FName, ...
    (microsoft.public.excel.programming)
  • Re: Graphics Dir List
    ... Scripting is really powerful. ... >One may want dimensions but another may want date photo ... >> or could see in a folder window). ... >>>>> what shows up in Windows Explorer? ...
    (microsoft.public.windowsxp.general)
  • Re: Folder share with disk quota using commands.
    ... read more about scripting on ... >>corresponding department groups. ... Set modify permission for user. ... >>Create one public folder for file sharing in department. ...
    (microsoft.public.windows.server.active_directory)
  • Re: 0x80072EFD
    ... Run this command to see what proxy configuration WU uses: ... Note that a side effect of renaming or deleting the SoftwareDistribution ... folder is that you lose your WU v5 History listing. ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsupdate)
  • Re: XP UPDATES
    ... Removing the updates will most likely not free up any memory, ... If you have a folder ... Remove Hotfix Backup files and the Add/Remove Programs Registry entries ... Microsoft MVP Scripting and WMI, ...
    (microsoft.public.windowsxp.security_admin)