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
- 0
VBSCRIPT
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")
End If
objFSO.MoveFolder DocumentumDir & "ucf" , DocumentumDir & "ucf.old"
End If
''________________________________________________ __________________________________________________ _____________________________
Function ExpandEvnVariable(ExpandThis)
ExpandEvnVariable = objWSHShell.ExpandEnvironmentStrings("%" & ExpandThis & "%")
End Function
-
-
IDG Tech News
-
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 :-)
Code:
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
-
-
2nd June 2008, 05:44 PM #3
- Rep Power
- 0
OK, so I just name this with a .vbs and replace this with the old file?

Originally Posted by
srochford
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 :-)
Code:
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
-
SHARE:
Similar Threads
-
Replies: 7
Last Post: 23rd September 2011, 03:21 PM
-
By Geoff in forum Scripts
Replies: 4
Last Post: 13th September 2007, 08:56 PM
-
By sqdge in forum Scripts
Replies: 20
Last Post: 13th September 2007, 03:34 PM
-
By StewartKnight in forum Coding
Replies: 5
Last Post: 1st May 2007, 11:04 AM
-
By mac_shinobi in forum Scripts
Replies: 1
Last Post: 14th September 2005, 08:21 AM
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
-
Forum Rules