Scripts Thread, batch file comman in Coding and Web Development; Hello,
we have a set of user home folders that have been migrated from our old domain to our new ...
12th August 2008, 08:36 PM #1
IDG Tech News
12th August 2008, 08:45 PM #2
Well you could script it (i have one at work i can provide) or you could use the free NTFSFix
WiseSoft - NTFSFix. NTFS Permissions Utility.
Last edited by cookie_monster; 12th August 2008 at 08:50 PM.
13th August 2008, 01:27 AM #3
I found this VB script, but I havn't personally tested it, so use it with caution. It seems to do what you want, as long as the username is exactly the same as the folder name you're changing.
You can change the CACLS command line to totally replace the ACL if your ACLs are totally broken, follow the help attached to the CACLS program to find out what switches you need to change. You will also need to add in the other users you want to have access e.g adminstrator to the end of the CACLS line if you do this. Running it in its current form edits the ACL and adds in the necessary permissions for the matching user only.
If running it on the server, which I would recommend you do, and not from a workstation across the network, change from using the UNC path to the local path insted.
Set objFSO = CreateObject("Scripting.FileSystemObject")
strPath = "\\Server\HomefolerPath" '<--- Homefolder UNC path
Set objFolder = objFSO.GetFolder(strPath)
Set colSubfolders = objFolder.Subfolders
For Each objSubfolder in colSubfolders
strFolderName = objSubFolder.Name
Set objShell = CreateObject("Wscript.Shell")
strExec = objShell.Run("%COMSPEC% /c Echo Y| cacls " _
& strFolderName & " /E /T /P " & strFolderName & ":F ", 2, True) '<--- 1st "strFolderName" reflects the homefolder name. 2nd "strFolderName" reflects Username
If strExec <> 0 Then
MsgBox "Error with " & strFolderName & " and folder: " & strFolderName
hope that's of help.
13th August 2008, 07:10 AM #4
I was just about to suggest this and realised you had already - anyway just wanted to add a side note and mention that registration is free and then you can get to the downloads ( which are obviously free as well ) afaik ( at least they were last time I checked )
Originally Posted by cookie_monster
very handy utils on that site as well ( password changer, ntfs fixer ) and possibly some other ones.
By karldenton in forum Windows
Last Post: 23rd March 2010, 05:16 PM
By meastaugh1 in forum Windows
Last Post: 17th January 2008, 08:02 PM
By MrLudwig in forum Windows
Last Post: 8th December 2007, 02:40 AM
By macca in forum Windows
Last Post: 3rd May 2007, 09:20 AM
By beeswax in forum Scripts
Last Post: 3rd March 2006, 07:48 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)