Questions tagged [cacls]

Windows command that Displays or modifies discretionary access control lists (DACL) on specified files.

Useful links:

  1. CACLS on technet.
  2. CACLS on SS64 help pages.
41 questions
1
vote
2 answers

failure to edit hosts file permissions

I am attempting to write a batch file for editing the hosts file. I recieve access is denied when I attempt this: cacls hosts /e /p %username%:w what should my command look like? I can do it graphically by hand so I know its doable Thanks in…
jth41
  • 3,808
  • 9
  • 59
  • 109
1
vote
0 answers

how to input the path name of folder/file and username/hostname in cacls

i have tried these following syntax: public class Main { private static String isi; public static void main(String[] args) throws InterruptedException, IOException { String host = ""; String dir = "" ; Scanner inputScanner = new…
1
vote
1 answer

icacls run from Wix CAQuietExec behaving differently than when run from dos command line

using Wix 3.5 on Windows 2008 R2 x64 I am running this as administrator to avoid any permission issue. I created an installer that executes the icacls command to add a user to the ACL of the c:\windows\system32\inetsrv\config\administration.config…
0
votes
1 answer

Unlocking file with CACLS command

The temptation was too great I had to test if for my self, I’m talking about the CACLS command I used the following to lock a file from everything CACLS C:\test.txt /p :n Nice though I did this with the impression that: CACLS C:\test.txt /p :f…
LabRat
  • 1,996
  • 11
  • 56
  • 91
0
votes
1 answer

How to Access the Undeletable directory/file in windows operating system?

I have doubt in directory undeletable concept. In Windows operation system, we convert a Undeletable file or folder in to deletable by using the command as "cacls FolderName /e /c /g %username%:f". I used the same command to access the "Undeletable…
Aerrow
  • 12,086
  • 10
  • 56
  • 90
0
votes
2 answers

Undeletable Folder in java

I tried to create a Undeletable folder using java code. I use the command "cacls (Foldername) /e /c /d %username%" in command prompt it worked fine.Then i tried to implement in my java class (Eclipse IDE). It doesn't…
Aerrow
  • 12,086
  • 10
  • 56
  • 90
0
votes
1 answer

How can I reset the permissions of files via powershell that originated from a user's personal directory?

I've run into an issue where users scan PDFs via the copy machine into their personal user folder on a file server. (The copier has a domain user account that owns a subfolder within each users' personal folder (D:\FileShare\Users\JohnSmith\Scans)…
0
votes
1 answer

Copying a file from C:\Windows\System32 folder to C:\Windows\SysWOW64 folder using Fortran and/or C++

I am trying to copy a file from C:\Windows\System32 folder to C:\Windows\SysWOW64 folder using Fortran and/or C++ code(s). Fortran code: call system ('copy C:\Windows\System32\filename.extension C:\Windows\SysWOW64\filename.extension') end C++…
0
votes
1 answer

How to set full control permission for file and folder on Windows with cmd?

I'm trying this below. Than read, write & execute permission can stop, but file rename I can't stop with this command. CACLS files /e /p {USERNAME}:{PERMISSION} Where, /p : Set new permission /e : Edit permission and kept old permission as it is…
Abdul Bari
  • 1
  • 1
  • 1
0
votes
1 answer

Q: Using CACLS on a protected file such as WMIC.EXE

I want to change permissions on a protected file. Using WMIC.EXE as an example, I want to change Administrators to F from R. CACLS c:\windows\system32\wbem\wmic.exe Returns: NT SERVICE\TrustedInstaller:F BUILTIN\Administrators:R NT…
Bruce Gavin
  • 349
  • 3
  • 9
0
votes
0 answers

Unable to write file in using cacls.exe

For installation using .NET, I wish to give write permission to a particular file in the folder using cacls.exe, so I have referred How to give Read/Write permissions to a Folder during installation using .NET and I have used the code from Setting…
user2587
  • 149
  • 10
0
votes
1 answer

cacls set permission for everyone

Scenario is as follows: -Execute cmd with admin privileges -mkdir a new folder, let there be jzzz -How can you grant full privileges to all users in the system, by means of cacls? [Note that I mentioned cacls, not icacls] I've tried echo S | cacls…
glezo
  • 742
  • 2
  • 9
  • 22
0
votes
1 answer

c# View folder permissions

I can search folder permissions using cacls.exe with command prompt and output them to a text file but I need to display the folder permissions within the C# program so that i can use them in strings etc.
Chris
  • 1
  • 2
0
votes
0 answers

Using ICACLS to set permissions on folder and new files, but excluding a specific folder

I am trying to use ICACLS to set the permissions on a directory. I want all new and existing objects in the directory to have the permissions I set, EXCEPT one specific folder I know the name of. This folder does not need the permissions and is…
Seephor
  • 1,692
  • 3
  • 28
  • 50
0
votes
1 answer

How to list CACLS (rights) for a folder and log to disk

What I want to know is how can I write the CACL rights of a folder recursively (folders and files) out to disk. I want to write two different folders out and compare them using two output files in a tool like winmerge. I have a website that works…
kyleb
  • 1,968
  • 7
  • 31
  • 53