Pauldg Posted February 16, 2009 Posted February 16, 2009 Hi, I am trying to create a VBScript to delete a spcific folder once I have gained the information from the registry. I have been able to create a script to identify the specific location of the folder (this different for every user) but I just don't know how to delete the folder once I have the information. I am wanting to delete the Outlook securetemp folder, several users seem to be having a problem with these folders filling up and then they are unable to view images in emails sent to them. Because each user has a slightly different secure temp folder location (microsoft thing) I need to create the script where it identifies the location first and then deletes the folder and recreates it after being deleted. is this possible and could anyone give me a suggestion on how to create this. To call for the inforamtion on the location this is what I have so far; Option Explicit Dim objShell Dim regSecureTempFolder Dim SecureTempFolder on error resume next regSecureTempFolder = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder" Set objshell = CreateObject("Wscript.Shell") SecureTempFolder = objshell.RegRead(regSecureTempFolder) Thanks for you ideas
mac_shinobi Posted February 16, 2009 Posted February 16, 2009 Option Explicit Dim objShell Dim regSecureTempFolder Dim SecureTempFolder on error resume next regSecureTempFolder = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder" Set objshell = CreateObject("Wscript.Shell") SecureTempFolder = objshell.RegRead(regSecureTempFolder) dim filesys, demofolder set filesys = CreateObject ("Scripting.FileSystemObject") set demofolder = filesys.GetFolder(regSecureTempFolder) demofolder.Delete As long as the regSecureTempFolder variable has the full path to the folder it should be fine also there is this site : http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/filesfolders/folders/ 1
Pauldg Posted February 16, 2009 Author Posted February 16, 2009 Thanks for the ideas & advise, I will add the site you mentioned to my group of growing reference sites.
mac_shinobi Posted February 16, 2009 Posted February 16, 2009 no problem if you go here ( which is the same site ) Windows Management Script Center That has a list of what you are trying to do and it will list relevant scripts depending on what you are trying to do. Also computer performance is a good one : Free example scripts VBScript, Windows Active Directory Tutorials
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now