Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-04-04
2
Medium Priority
?
381 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 375 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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 …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

722 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