Solved

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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