icacls issue

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

icacls issue

#1 Post by Ed Dyreen » 09 Jul 2019 14:25

Hi,

I cloned a windows 7 ntfs system partition and mounted it as non-system drive D but am unable to copy
"D:\Users\Administrator\AppData\Local\Application Data\*"

using icacls I try to remove the DENY everybody ACL to gain access but it is still failing with

Code: Select all

"icacls.EXE" %sFullPathFile% /T /remove %abstractLocale.sACLeverybody%
"icacls.EXE" %sFullPathFile% /T /grant %sGroup%:%sPermission%

Code: Select all

D:\Users\Administrator\AppData\Local\Application Data\Application Data\Applicati
on Data\Application Data\Application Data\Application Data\Application Data\Appl
ication Data\Application Data\Application Data\Application Data\Application Data
\Temporary Internet Files: Het systeem kan het opgegeven pad niet vinden.
I am simply trying to move/copy "D:\Users\*" to "D:\profsys\*" as an exact copy on a mounted non-system drive to a mounted non-system drive.

https://wordlinks.wordpress.com/2010/10 ... recursion/

I've tried

Code: Select all

robocopy.EXE "D:\users" "D:\profsys" /E /ZB /COPY:DATSOU /PURGE /SL
xcopy  "D:\users" "D:\profsys" /E /V /I /H /R /K /X /Y /B
the last xcopy looked to be working at first, but on close inspection I found it didn't copy the "Application Data" Shortcut but created a folder named "Application Data". So this also fails to create an exact mirror. I assume backup software can do what I want, so I'd need to figure out how does backup software accomplish this task ?

I should also not call it shortcut even though it has an arrow because a shortcut has the .LNK extension and microsoft now likes to call it a file shortcut. they invented something new to annoy everybody a symbolic folder link

Code: Select all

mklink /J "%userprofile%\AppData\Local\Application Data" "%userprofile%\AppData\Local"
which is basically a shortcut without the .LNK extension as to not confuse, annoy or irritate anybody. Something similar exists on the eXPerience platform, called hard links which are pointer to a file to save space when duplicates exist.

For now I will just rename "D:\users\" to "D:\profsys" and then create a copy to D:\users using the previous commands, this will result in a broken D:\users folder and a correct D:\profsys folder. Since D:\users will be completely removed later I can hack my way out of this this way but it's ugly. :?

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: icacls issue

#2 Post by Ed Dyreen » 10 Jul 2019 04:58

This works.

Code: Select all

Call oFSO.MoveFolder( "D:\Program Files", "D:\prgmSys" )
sArgs = """D:\prgmSys"" ""D:\Program Files"" /E /V /I /H /R /K /X /Y /B"
Call abstractProcess.exec_( "xcopy.EXE", sArgs, "", True, 0 )

Call oFSO.MoveFolder( "D:\" &oDirProfiles.Path, "D:\profSys" )
sArgs = """D:\profSys"" ""D:\" &oDirProfiles.Path &""" /E /V /I /H /R /K /X /Y /B"
Call abstractProcess.exec_( "xcopy.EXE", sArgs, "", True, 0 )
Now I only need to update the registry to point to the new locations.

Post Reply