Solved

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

Posted on 2007-04-04
2
373 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now