+ Post New Thread
Results 1 to 2 of 2
How do you do....it? Thread, Delete a folder using Vbscript in Technical; I trying to edit this script so that it deletes the ucf folder instead of renaming it to .old. sDS="c:\documents ...
  1. #1

    Join Date
    May 2008
    Posts
    14
    Thank Post
    9
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Delete a folder using Vbscript

    I trying to edit this script so that it deletes the ucf folder instead of renaming it to .old.


    sDS="c:\documents and settings\"
    set oFolder=ofso.getfolder(sDS)
    for each oSubFolder in oFolder.subfolders
    DocumentumDir = sDS & oSu.name & "\Documentum\"
    If oFSO.folderExists(DocumentumDir & "ucf") Then
    If oFSO.folderExists(DocumentumDir & "ucf.old") Then
    oFSO.deleteFolder(DocumentumDir & "ucf.old")
    End If
    oFSO.MoveFolder DocumentumDir & "ucf" , DocumentumDir & "ucf.old"
    End If
    next

  2. #2
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    467
    Thank Post
    14
    Thanked 50 Times in 48 Posts
    Rep Power
    23
    You need to do
    Code:
    set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.DeleteFolder(strFolderPath)
    See
    Delete folder (VBScript) - Windows Server Cookbook

  3. Thanks to Jona from:

    soze (3rd June 2008)

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 2
    Last Post: 17th April 2008, 11:25 AM
  2. Wanted: VBScript to delete folders from C:
    By timbo343 in forum Scripts
    Replies: 7
    Last Post: 7th February 2008, 11:50 AM
  3. Delete a folder using scripting
    By FN-GM in forum Scripts
    Replies: 15
    Last Post: 22nd December 2007, 04:44 PM
  4. Replies: 8
    Last Post: 17th November 2007, 09:04 PM
  5. Got a folder I cannot delete or take ownership of
    By sidewinder in forum Windows
    Replies: 2
    Last Post: 20th March 2007, 02:49 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
  •