How do you do....it? Thread, Proper syntax to delete folder from Multiple Profiles in Technical; Does anyone know what Syntax is needed to delete a certain folder from every profile on a machine. exp.
3rd June 2008, 12:24 PM #1
- Rep Power
Proper syntax to delete folder from Multiple Profiles
Does anyone know what Syntax is needed to delete a certain folder from every profile on a machine. exp.
' ------ SCRIPT CONFIGURATION ------
strFolderPath = "<FolderPath>" ' e.g. "d:\temp"
' ------ END CONFIGURATION ---------
set objFSO = CreateObject("Scripting.FileSystemObject")
ObjFSO.DeleteFolder("C:\Documents and Settings\qt34064\Documentum\UCF")
WScript.Echo "Successfully deleted folder"
I want to remove it from Qt34065, Qt23404 and so on. How can I edit this in order for this to happen?
IDG Tech News
3rd June 2008, 01:17 PM #2
I'm guessing you're trying to delete the folder "documentum" and everything under it that's in any user profile folder on the machine?
If so then this should work:
the wscript.echo line is for testing; what I do with something like this is to leave in the echo line but comment out the delete line - that way I can see what folders are going to be deleted before it all goes horribly wrong :-)
sRoot="c:\documents and settings\"
for each oSubFolder in oFolder.subfolders
sName=sRoot & oSubFolder.name & "\" & sFolder
if ofso.folderexists(sName) then
ofso.deletefolder(sRoot & sName & "\" & sFolder,true)
When you are sure you're working with the right set of folders then you can comment out the echo line and uncomment the delete line.
Thanks to srochford from:
3rd June 2008, 02:54 PM #3
- Rep Power
I'm trying to delete the UCF directory under Documentum for every profile, so can I just change the sFolder= to UCF instead of Documentum?
Originally Posted by srochford
By chrbb in forum Scripts
Last Post: 4th February 2010, 05:15 PM
By JPhillips173 in forum Scripts
Last Post: 17th April 2008, 11:25 AM
By Simcfc73 in forum Windows
Last Post: 15th January 2008, 06:29 PM
By timbo343 in forum Scripts
Last Post: 19th September 2007, 10:46 PM
Last Post: 14th October 2006, 08:20 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)