How do you do....it? Thread, VBSCRIPT in Technical; I'm trying to edit this script so that it clears the contents of the "UCF" directory for everyone who logs ...
2nd June 2008, 04:35 PM #1
- Rep Power
I'm trying to edit this script so that it clears the contents of the "UCF" directory for everyone who logs on the machine. Right now it only clears the current logged on user.
Any help would be appreciated, I have very limited scripting knowledge.
Dim objWSHShell :Set objWSHShell = CreateObject("WScript.Shell")
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
DocumentumDir = ExpandEvnVariable("userProfile") & "\Documentum\"
If objFSO.folderExists(DocumentumDir & "ucf") Then
If objFSO.folderExists(DocumentumDir & "ucf.old") Then
objFSO.deleteFolder(DocumentumDir & "ucf.old")
objFSO.MoveFolder DocumentumDir & "ucf" , DocumentumDir & "ucf.old"
''________________________________________________ __________________________________________________ _____________________________
ExpandEvnVariable = objWSHShell.ExpandEnvironmentStrings("%" & ExpandThis & "%")
2nd June 2008, 05:04 PM #2
If you're tring to set it so that when user1 logs on to the machine it clears this folder under docs and settings for each user then you can't :-(
The docs and settings folders will be configured so that only the owner has rights to it (so user1 has rights to the user1 folder but not the user2 folder etc)
You can do it in the machine startup script but that's hard work unless you can assume that the D&S root is c:\docs and settings.
If that's OK then this should be on the right lines - note I haven't checked it but it's about right :-)
sDS="c:\documents and settings\"
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")
oFSO.MoveFolder DocumentumDir & "ucf" , DocumentumDir & "ucf.old"
2nd June 2008, 05:44 PM #3
- Rep Power
OK, so I just name this with a .vbs and replace this with the old file?
Originally Posted by srochford
Last Post: 23rd September 2011, 03:21 PM
By Geoff in forum Scripts
Last Post: 13th September 2007, 08:56 PM
By sqdge in forum Scripts
Last Post: 13th September 2007, 03:34 PM
By StewartKnight in forum Coding
Last Post: 1st May 2007, 11:04 AM
By mac_shinobi in forum Scripts
Last Post: 14th September 2005, 08:21 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)