Solved

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

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

830 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