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 folders" (for example Recovery, Documents and Settings etc.,), which is present in the C: drive. It doesn't work. How they create this kind of folders. If any other ways to do this. Kindly clear me. Thanks in advance.
Those folders have the "list folder/read data" permission set to deny for everyone. Deny takes precedence over allow, so it doesn't matter what permissions you give to a user: the deny setting will overrule it. You have to remove that setting first, which probably means you also have to take ownership first. They're owned by SYSTEM.
Related
I'm trying to set up a series of local directories on an OSX 10.9 machine which is connected to a windows domain. I have set the folders to have the correct permissions.
for example the "INTAKE07" directory has read/write permissions for any users in the network group INTAKE07. But whenever a user from this group makes a new subdirectory it only has read/write permissions for the owner and not for that network group.
I believe I the answer might be something to do with umask, but I have no idea.
Any help will be appreciated. Thank you
Sorted it with this command in the end:
chmod +a "group:DOMAIN_NAME\Intake07 allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" /path/to/folder
I have two network drives that I access through Windows 7: V:\ and T:\ I am trying to create shortcuts between the two that alphabetise with folders (rather than files), so I am using the mklink command:
mklink /d \Photos V:\Photos
which creates a symlink at C:\.
I can move the symlink around locally. However, when I try to move the symlink to a network location, it begins copy the actual files over rather than symlinking them.
I figure that if I can create a symlink of a network drive on a local drive, what's stopping me creating a symlink of a network drive on another network drive. Am I correct in assuming this?
Is there any way to designate the destination file path when creating symlinks with the mklink command? Or is there any way to move symlinks to a network drive at all?
If you need to make a directory junction (using /J) on a network drive, you can first creation a directory (/D) symbolic link and then create a junction off of that, like so:
mklink /D D:\shareLink \\network\share
mklink /J D:\junctionLink D:\shareLink
You need to enable local to remote links by running this command with elevated rights:
fsutil behavior set SymlinkEvaluation L2R:1
Also you can enable this with your local or group policy:
Computer\System\Filesystem\Selectively allow the evaluation of a symbolic link --> allow local to remote
You will need to log onto the computer hosting the network drive and run the mklink command from there.
I recommend creating a junction /J instead of a symlinkd /D. Symlinks have some additional settings you need to be aware of. See symbolic-link-cannot-be-followed.
I'm trying to create a symbolic link between two directories. I have a directory called TestDocs and TestDocs2. I will be doing all my work in TestDocs, but I need it all to be reflected in TestDocs2. So all files that are in TestDocs2 will be replicated in TestDocs, and if I add a file, change a file, etc in TestDocs it should be reflected in TestDocs2.
So I thought it would be as simple as just doing this:
mklink /D TestDocs TestDocs2
But when I do that I get the error:
Cannot create a file when that file already exists
Why am I getting this?
Also, do I have the order of my TestDocs and TestDocs2 wrong in the command?
Thanks for the help, Symbolic Links have always confused me!
The correct usage is:
MKLINK [options] {link} {target}
You're creating a link, so the link is the new link you're about to create.
And the target is the link's target, which is the existing directory.
Here is how that worked for me.
I wanted to relocate my C:\ProgramData\Package Cache to F: partition.
Steps I had to do:
Physically move "C:\ProgramData\Package Cache" to F:. Now I had "F:\ProgramData\Package Cache" and "C:\ProgramData\Package Cache" is gone since I moved it.
In cmd run (all in one line, split here for readability)
mklink /J "C:\ProgramData\Package Cache"
"F:\ProgramData\Package Cache"
Result:
Junction created for C:\ProgramData\Package Cache <<===>>
F:\ProgramData\Package Cache`
I did this for Google Picasa so I could access photographs on more than one machine. It works very well as Picasa is not really a netowrk enabled program.
For me I did the following:
Install Picasa
Run the application. This will create all the necessary database files.
Close the application.
Navigate to the directory where the database is - on Windows 7 it will be created in c:\users\\AppData\Local\Google
There will be two folders Picasa2 and Picasa2Albums
Copy these folders to a network location. In my case I created a folder called o:\PicasaDatabase and copyied these folders into it.
Next rename the original folders to Picasa2.old and Picasa2Albums.old
Run the following commands from an elevated cmd prompt:
mklink /D "c:\Users\\AppData\Local\Google\Picasa2" "o:\PicasaDatabase\Picasa2"
mklink /D "c:\Users\\AppData\Local\Google\Picasa2Albums" "o:\PicasaDatabase\Picasa2Albums"
Two symbolic links will have been created in the source location and they will point to the network drive.
Obviously using symbolic links like this is a workaround for application that are not networkable and only one user can access the database at once.
I had the same issue. You have to make sure the Source folder does not already exist. (if it does , then rename it to something else)
In case of below Backup folder should not exist under MobileSync. Since Apple iTunes looks for Backup folder with that name, just rename the existing folder to something like OriginalBackup to avoid iTunes from finding it. Instead the mklink will synonym Backup to D: folder as below
mklink /J C:\Users\Dell\Apple\MobileSync\Backup D:\Apple\Backup\iPhoneXRBackup
I had this error. Two things I did to fix it.
check I was actually in the directory I thought I was and not another one with a very similar path.
put quotes around the new link name.
First attempt:
mklink /d \shared_files ....\my-app-public\src\shared_files
gave error described.
Second attempt:
mklink /d “.\shared_files” ....\my-app-public\src\shared_files
worked fine.
I have a folder with permissions already set, in that folder I have some files that should all have the same permissions as the parent folder, the only thing is when these files get replaced by the updater the permissions change.
How can I have the updater replace these files's permissions again with the parent folder's?
Deal with acls sometimes could be annoying, be careful and good luck.
Here is a well-explained article http://msdn.microsoft.com/en-us/magazine/cc163885.aspx
And you could see the icacls and cacls commandline tools.
Use with careful and try to backup before.
We have two users:
user1
user2
They both belong to the group 'admin'.
We have a directory that has been set to 775. The directory's group has been changed to 'admin'. Each user has full access to write into that directory, though when a user writes a new file to the directory, the group permissions of the folder are not persisted to the file that was written.
How should we make it so that files inherit the directory's group permissions?
Clarification: when a new file or directory is written, it uses the users' group as the group of the new file, rather than that of the directory, which makes sense - but how do I not make that happen?
You can propagate group permissions by setting the directory's setgid bit (chmod g+s). This may not be portable across all *nixes and all file systems.
http://en.wikipedia.org/wiki/Setuid#setgid_on_directories
http://www.gnu.org/software/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html
If you are using ext3 or ReiserFS, this page about creating a Linux file server may help. Specifically step 7 suggests the following command.
setfacl -d -m g:sales:rw /groups/sales
I think you should look here.
As the site says, "Unix doesn't support the idea of inherited permissions."
However, there is a section on ACLs (Access Control Lists), which I think is what you are looking for. By setting up an ACL, you can have your files inherit the same ACL from the directory, which I think is what you are asking for. setfacl is the shell command that will be what you need to look into.
Hope that helps!