windows - Icacls, problems with permission in subfolder of Program Files (x86) -
the problem have persistent. have self-extracting rar file, files.rar. being uncompressed in c:\program files (x86)\companyname\xds\bin
now starts batch file, install.bat, in bin folder. 32 bit version of cmd.exe executes batch file. far good, works well.
but: have rename 1 file in bin folder , delete another. may wonder, why put file in there needs deleted? well, have 32 , 64 bit version of driver. depending on target, either 1 of these must renamed natusb.dll, while other must deleted.
if run batch file (simplified):
icacls natusb*.dll /inheritance:r /grant:r everyone:(oi)(ci)f icacls natusb*.dll /t rename natusb_32_ezusb.dll natusb32.dll del natusb_32_winusb.dll
i have following problems:
- i need administrator rights , not acceptable purpose of company
- even "access denied" renaming, possibly since there exists natusb32.dll. however, administrator can not delete file: "access denied"
- the del natusb_32_winusb.dll gives "access denied"
then tried copy 2 files bin2. reason this: if "icacls bin /t" list of files permission info on long, hoped info few files. unfuntunately, "access denied" (while trying copy bin2), while file permissions administrator , system "full control". btw, icacls natusb*.dll /t not give permissions, seems work entire folders.
when in xsd (parent) folder , "icacls bin2 /inheritance:r /grant:r everyone:(oi)(ci)f" next, "icacls bin2 /t"
bin2 everyone:(oi)(ci)(f) builtin\users:(oi)(ci)(f)
i still cant copy few nat*.dll bin bin2.
if try set access rights on bin folder (very similar above), "bin: handle invalid".
btw, permissions on bin follows:
bin nt service\trustedinstaller:(i)(f) nt service\trustedinstaller:(i)(ci)(io)(f) nt authority\system:(i)(f) nt authority\system:(i)(oi)(ci)(io)(f) builtin\administrators:(i)(f) builtin\administrators:(i)(oi)(ci)(io)(f) builtin\users:(i)(rx) builtin\users:(i)(oi)(ci)(io)(gr,ge) creator owner:(i)(oi)(ci)(io)(f)
and stated before, icacls can't change of this. btw, security tab doesn't show duplicate groups or names.
in short: have problems renaming, deleting files (must urgent, solve current problem) , copying files c:\program files (x86)\xxx\xds\bin xds\bin2.
to solve problems, need use icacls or build in command in script force access rights. setting access rights in security tab of folder not acceptable: needs done script. also: can not install 3rd party software, not if large or has commercial license. few kb, perhaps 1mb free use tool may acceptable if else fails.
the solution should not require administrator rights.
any appreciated.
this main problem:
icacls natusb*.dll /inheritance:r /grant:r everyone:(oi)(ci)f
the (oi)(ci)
flags valid directories, not files. because flags invalid, permission ignored. net effect of command remove permissions file, implicitly denying access everyone, including administrators.
if take out invalid flags, command work expected:
icacls natusb*.dll /inheritance:r /grant:r everyone:f
however, given description of problem, looks if will require admin access, because permissions on existing folder read-only non-administrators. there's no way around that, unless can install different folder (e.g., in user's application data folder) or change destination folder permissions in advance.
note changing folder permissions introduce security vulnerability.
Comments
Post a Comment