Solved

VB Login Script that will empty temp folders and temporary internet files.

Posted on 2007-04-04
2
378 Views
Last Modified: 2012-05-05
Is there a VB Login Script that will empty a user's temp folder and temporary internet files?
0
Comment
Question by:Jackspiner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 125 total points
ID: 18852169
Something like this...


Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")
Dim objShell: Set objShell=CreateObject("Wscript.Shell')
strTemp=objShell.ExpandEnvironmentStrings("Temp")
strInet=objShell.ExpandEnvironmentStrings("UserProfile") & "\Local Settings\Temporary Internet Files"
Dim objFolder: Set objFolder=objFSO.GetFolder(strTemp)
For Each File in objFolder.Files
  objFSO.DeleteFile (file)
Next
Dim objFolder: Set objFolder=objFSO.GetFolder(strInet)
For Each File in objFolder.Files
  objFSO.DeleteFile (file)
Next
Set objFolder=Nothing
Set objShell=Nothing
Set objFSO=Nothing
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18870465
Why the "B"?  Something not work for you?  I'd have rather helped you sort it out...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question