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 & "%")
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"
OK, so I just name this with a .vbs and replace this with the old file?
Originally Posted by srochford