+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, VBScript to delete specific folder using Registry info. in Coding and Web Development; Hi, I am trying to create a VBScript to delete a spcific folder once I have gained the information from ...
  1. #1

    Join Date
    Feb 2009
    Location
    Queensland
    Posts
    2
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    VBScript to delete specific folder using Registry info.

    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

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,855
    Thank Post
    3,374
    Thanked 1,065 Times in 984 Posts
    Rep Power
    367
    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/activmon...lders/folders/

  3. Thanks to mac_shinobi from:

    Pauldg (16th February 2009)

  4. #3

    Join Date
    Feb 2009
    Location
    Queensland
    Posts
    2
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Smile Thanks

    Thanks for the ideas & advise, I will add the site you mentioned to my group of growing reference sites.

  5. #4

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,855
    Thank Post
    3,374
    Thanked 1,065 Times in 984 Posts
    Rep Power
    367
    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

SHARE:
+ Post New Thread

Similar Threads

  1. vbscript to copy a folder & delete a folder
    By MicrodigitUK in forum Scripts
    Replies: 2
    Last Post: 29th January 2009, 12:43 PM
  2. Script to delete specific folders
    By Baasha_Bhai in forum Scripts
    Replies: 8
    Last Post: 2nd July 2008, 10:41 AM
  3. Delete a folder using Vbscript
    By soze in forum How do you do....it?
    Replies: 1
    Last Post: 2nd June 2008, 08:59 PM
  4. Wanted: VBScript to delete folders from C:
    By timbo343 in forum Scripts
    Replies: 7
    Last Post: 7th February 2008, 11:50 AM
  5. Replies: 15
    Last Post: 19th September 2007, 10:46 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •