General discussion

Locked

Temp File deletion needed!!!

By keebmachine ·
I need a script (.vbs,.bat,.wsh, etc.) that will enumerate all user profiles on a computer and then delete \local settings\temp and local settings\temporary internet files\

It will have to run as a startup script using local system privileges in order to access these directories.

The script file will begin by outputting the profiles to a text file for example:
dir "c:\documents and settings\">directories.txt

The contents of this file will look something like this:
Volume in drive C has no label.
Volume Serial Number is E0000-0000

Directory of c:\documents and settings

02/15/2005 03:46 PM <DIR> .
02/15/2005 03:46 PM <DIR> ..
06/19/2003 05:33 PM <DIR> SMITHC
02/15/2005 03:46 PM <DIR> TAYLORA
02/01/2005 07:32 AM <DIR> WILLIAMSR
0 File(s) 0 bytes
3 Dir(s) 22,949,040,128 bytes free

The script file will read the contents of this file and discover that there the following folders for SMITHC, TAYLORA and WILLIAMSR exist and delete the ?local settings\temp? and ?local settings\temporary internet files? subdirectories of these directories

Any ideas?

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by w2ktechman In reply to Temp File deletion needed ...

Add this to your command line for temp and tmp
%USERPROFILE%\Local Settings\Temp

Collapse -

by keebmachine In reply to

This will only delete for the current user not all users.

Collapse -

by razz2 In reply to Temp File deletion needed ...

You can just use %TEMP% and %TMP%.

Good Luck,

razz

Collapse -

by keebmachine In reply to

I have tried that and it will only delete the temp files for the current user. I need a script not just suggestions on what to place in the script.

Collapse -

by sgt_shultz In reply to Temp File deletion needed ...

Help Yourself FREE to all the scripts and scripting help FREE FREE FREE from technet.microsoft.com. but wait! theres more! if you act NOW to figure this out for yourself within the NEXT 60 MINUTES, you can keep all your tech republic POINTS for YOURSELF! AND, if you post a question to the scripting forum at technet.microsoft.com there A SPECIAL BONUS gift of learning how to use login scripts AND GPO's will you YOURS for the asking...but WAIT! can you believe there is EVEN MORE! Check out the FREE internet explorer resource kit!! included FREE as a special GIFT for SPECIALLY SELECTED IT Pros! JOB SECURITY GUARANTEED! do not miss out on this fantastic offer. as it will not be repeated soon in this area!

Collapse -

by razz2 In reply to Temp File deletion needed ...

" Comment from snlcoleman@... on 02/16/05:
I have tried that and it will only delete the temp files for the current user. I need a script not just suggestions on what to place in the script."

Well ok then. I need someone to write me some scripts too. Sorry for trying to assist YOU in writing YOUR script. I should have known you were too busy. Just for fun here is another "suggestion"...

Search google and find the resources I did and try writing the script to fit your exact needs.

Usually deleteing each users info when that user logs in or out would work fine. You might just want to delete any old profiles using delprof.exe and have it recreated each logon from a custom default.

This article would help maybe:

http://www.windowsitpro.com/Article/ArticleID/22710/22710.html

This article has a script for the local that could be modified:

http://www.tek-tips.com/viewthread.cfm?qid=992214&page=1

This article has a listing of 38 scripts to connect to special folders.

Good luck with that busy schedule,

razz

Collapse -

by keebmachine In reply to

Poster rated this answer.

Collapse -

by keebmachine In reply to Temp File deletion needed ...

This question was closed by the author

Back to Windows Forum
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums