| T O P I C R E V I E W |
| gustavobapti |
Posted - 11/07/2007 : 5:24:04 PM Hello all. In my windows 2003 domain all users have their H: drive (a network drive mapped by default during the logon). Physically the share is located on fileserver's d:/ drive.(D:/Home/). The share Users consists of folders for each of the users (D:/Home/jsmith, D:/Home/acarter… etc) I was requested to rename the old folder and create a new folder for each of the users called "Citrix" D:/Home/domainusername/Citrix
I would like to create a vb script to rename the old folder (Citrix to Citrixold) and create a new folder with the same old name " Citrix".
Option Explicit
Function ConfigHome(oUser, sPath, sSite)
set oWSH = CreateObject("WScript.Shell")
If Not FSO.FolderExists(sPath & "\CITRIX") Then
FSO.CreateFolder (sPath & "\CITRIX")
Else
FSO.MoveFolder sPath & "\CITRIX", sPath & "\CITRIX.old"
End If
If Not FSO.FolderExists(sPath & "\CITRIX") Then
FSO.CreateFolder (sPath & "\CITRIX")
Set oCitrixHD = FSO.GetFolder(sPath & "\CITRIX")
If not oCitrixHD.Attributes And 2 Then
oCitrixHD.attributes = oCitrixHD.Attributes XOR 2
End If
'WScript.Sleep 15000
call oWSH.Run("cmd /c echo y| CACLS " & sPath & " /t /e /g " & oUser.SamAccountName & ":f", 0, True)
'WScript.Sleep 5000
call oWSH.Run("cmd /c echo y| SubInACL /file " & sPath & " /setowner=Americas\" & oUser.SamAccountName, 0, TRUE)
'WScript.Sleep 5000
call oWSH.Run("cmd /c echo y| SubInACL /subdirectories " & sPath & "\*.* /setowner=Americas\" & oUser.SamAccountName, 0, TRUE)
End If
End Function
Thanks.
-------------------------------------------------------------------------------- Gustavo
|
|
|