How to copy a directory with all permissions and intact junctions?

Is it possible to copy a directory with junctions in there and have it copy as junctions, not the contents of the junction?

I'll try to make a long story short, but I just spent a few hours cleaning after robocopy and junctions hidden Windows 7.  I have Windows 7 installed on a spare HD so I can play with it, adjust, test things and figure out how I want to set up before taking the plunge and the replacement of XP full time.

Just as an experiment, I wanted to create a new user account, but put its directory of the user on another drive and use a symbolic link to point to her to C:\Users.  I created a new user account called Test, connected so that its directory was created and then disconnected.

I discovered that the moving or copying the files, either in Explorer or a command prompt does not move or copy the directory junctions.  I then tried Robocopy because it contains options to copy all security, owner, and audit information.  There is also an option "copy symbolic links from the target."

The exact command, I used was:
Robocopy C:\Users\Test/e/COPYALL /R:0 /SL D:\Users

First of all, there will be no even to copy permissions, the few records he did copy inherited permissions from the parent directory to the destination, and he added a strange permission that I'll get to in a minute.  It was not long until he stopped with the error.  I don't remember the error because I restarted several times since then, and I don't care to try again just to get the exact error message in order to post here.

What's happened, it's that there is a directory hidden in C:\Users\Test\AppData\Local junction.  Junctioin name is "Application Data" and it links to C:\Users\Test\AppData\Local (the same directory that is).  This caused his keep copy the folder "Application Data" on itself until the max file name length has been exceded and he stopped.

When I tried to delete the directory, I kept getting an error that it could not delete the directory because it was not empty.  I had total control over the directory, but I still have the error and the directory (from what I could see) was empty.

Here's the strange authorization occurs.  For some reason, copies of the "Application Data" directory were defined on system / hidden and everyone had group ' the folder list / reading data "permission set to deny, that's why I couldn't see, even in the administrator command prompt.

Once I got the permissions sorted, I could not delete the directory because the name was too long.  Windows told me to rename so it was more runs, then try again.  I finally managed to delete by renaming the directories in a few 'Application Data' to 'a' and then by moving the part of it to another directory.

Not for the faint of heart, but it's doable if you combine two tools in a Powershell script

I think that the simplest approach would be to use the http://pscx.codeplex.com/ Powershell Community Extensions to find source of junctions and create new ones to target. Then use SetACL http://setacl.sf.net/ to save the ACL from the source and then restore them to the newly created junction.

Should not be too many lines of code :-)

Tags: Windows

Similar Questions

  • How to build executable labview with all dependencies and libraries contained in .exe

    Hello

    I developed an application that uses several external libraries: JKI JSON string, Datagrid, etc... Under the build properties destinations, I select Main.exe. Under source code file settings, I have everything marked 'Set destinations for all content items' = Main.exe, 'Set destinations for packaged and shared libraries' = Main.exe.

    However, when the build is finished, I still find that JKI libraries are still in separate folders. There are literally dozens of JKI files, each of them contains 1 or 2 screws in addition, the same for the equipment operators.

    What I missed and how do I fix?

    Thank you!

    What LV version do you use?

    Make sure that you have not accidentally checked the box 'use LabVIEW 8.x file layout' in your build script.

    Norbert

  • How to protect a directory with password in windows XP?

    How to protect a directory with password in windows XP?

    XP does not use passwords to protect resources. NT operating systems use the permissions. Here's the information to help you with that:

    How to disable Simple Sharing and set permissions on a folder shared in Windows XP (Pro only)
    http://support.Microsoft.com/?kbid=307874

    How to configure file sharing in Windows XP (includes information about permissions):
    http://support.Microsoft.com/kb/304040

    By default in XP Home you can only files and folders under My Documents "private". Otherwise, to display the Security tab in Windows XP Home, restart in safe mode and log on with an account that has administrator privileges. Go in Safe Mode, press the F8 key as the computer starts. That you will get the menu where you can choose Safe Mode.

    Note that the file system must be NTFS, FAT32 not.

    Passwording of folders is not possible unless you their zip. When you do (right click on a folder, then "send to > compressed folder") and then open the zip file, you will find an option under file > "add a password." Otherwise, use a third-party software. Google "password protect folders".
    MS - MVP - Elephant Boy computers - don't panic!

  • Do you know how to copy certain tasks in the calendar and the past on different days?

    Do you know how to copy certain tasks in the calendar and the past on different days?

    This year, I even tasks to every month, so it is difficult for me to create new tasks for the same information. I can't find how to copy beyond the tasks, so if someone could help me I aprecciate it.

    Thanks in advance!

    Select, press COMMAND = C to copy it to the Clipboard; Select the date that you want a copy with the mouse, them press COMMAND\-V to paste. If you want a repetitive task, you can select the item and double-click it to open it, and then the pop up config, select repeat.

  • How can implement you not with Tim Capsule and AirPort their simulation on the iMac?

    Hello

    How can implement you not with Time Capsule and AirPort their simulation on the iMac?

    I don't know what you're asking.

    AirPort Extreme is a wireless router.

    A Time Capsule airport is an AirPort Extreme with a built-in hard drive for data storage.

    An iMac is a Mac computer.

    An iMac is not a wireless router, so he is unable to perform the functions of a wireless router.

  • How to me to work with Outlook 2016 and 10 windows iCloud?

    How to me to work with Outlook 2016 and 10 windows iCloud?

    1. uninstalled and reinstalled iCloud several times - no luck

    2 reinstalled Outlook 2016 - no luck

    3. the module removed and reinstalled only - no luck

    Help please... step by step would be appreciated.

    Hi xinggirl45,

    Thanks for your question.  Can you elaborate a little bit and let us know exactly what does not work?  The resources below provide some troubleshooting steps basic to work with Outlook and iCloud for Windows.

    Get help using Outlook with iCloud for Windows

    Take care.

  • How can I install my Windows 7 on a mac with all my files intact?

    I'm getting a Macbook Pro and I would like to install it on Windows 7 via Bootcamp. I have a few questions:


    1.) without having to buy a new Windows 7, can I use my current and transfer it on my Mac, with all my files with it?

    2.) If Yes, how can I make a copy of my Windows 7? What do I have to type in my license of something? Or open a file?


    I'm getting a Macbook Pro and I would like to install it on Windows 7 via Bootcamp. I have a few questions:


    1.) without having to buy a new Windows 7, can I use my current and transfer it on my Mac, with all my files with it?
    1 license, 1 computer. If your current copy of Windows 7 is installed on another computer, you cannot transfer it to your Mac unless that remove you it from the current computer. There are also a full commercial license.

    2.) If Yes, how can I make a copy of my Windows 7? What do I have to type in my license of something? Or open a file?
    Learn how to:

    See:

    also:


    The above mentions Windows 8, but the same principles apply to Windows 7, especially with the new MacBook Pro, who do not have optical drives.



  • How to copy a DVD with a DVD-R/W laptop?

    I have a laptop with a DVD-R/W. How to copy a DVD? I am puzzled, if I FIRST have to 'Save' DVD-content somewhere and then REMOVE the DVD and insert a blank DVD to burn. Please give directions to the not so computer expert. Thank you

    You must save a temporary copy of the disk on a hard disk of the computer.  Burning software more it will do it automatically for you.  As the same disk drive, select the source and the destination.

  • How to duplicate a layer with all of its attributes?

    Hi all experts of the AE,.

    I know it's a simple question, but it makes me against the wall.

    I have 8 layers.

    I want to copy the layer to layer 4 and put at between 4 and 5 layer layers.

    How do I do that?

    Thank you

    Press Cmnd/Ctrl + D

    or go to Edition > duplicate

    As you can see on the screenshot keyboard shortcuts are shown next to the command. It's really basic things. Maybe you should go through this video of Adobe TV.

  • I need to set up an administrator account on the PC of my wife with all permissions

    Need to create an administrator account

    Go to start / Control Panel / user accounts / click on create a new account / type a user name, and check the administrator button then click on create an account.  The new account will be displayed on the next screen and tell administrator under the name.  Double-click on this account and set a password, and other settings that you seem appropriate.  When finished, click on ok and the new account is created and ready to use.  All administrator accounts have all permissions but that does not give them access to each folder or a file on the system - there are still other restrictions of permission in place even for administrators and those just cannot be substituted during the creation of the account.  If you encounter "Access denied" as an administrator, you need to fix the problem by changing the permissions on the file, folder, folder parent or even it's parent.  You will also need to be supported.  There are some folders and files that even administrators are not allowed to access (junction points) called because there is no reason to go to these places and make changes it can damage the system.  I just want to be clear that 'right' has its limits, even if every administrator has them.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How can I export the schema with all objects and a few tables without data

    Hi all

    Verion 10g EA.
    I export the schema with all objects but I need ignored some of the data in the table.

    There is a table 4 people gave huge, we need not to export data from tables but structure must export.


    Thank you
    Nr

    You can do this with a single command.  Run your export as usual and add the query parameters for 4 tables you want all the lines:

    expdp... query = schema1.table1: "where rownum = 0" query = schema2.table2: 'where rownum = 0'...

    It is best to place the query parameters in a parameter file if you don't have to worry about escaping special characters of the OS.

    Dean

  • How can I transcode images with all 4 audio channels of P2?

    I'm in transition from FCP7 to Premiere Pro CS6, and one of the single crash that I meet is transcoding P2 footage and keep all the 4 audio channels separated.  I can't find a way where prelude compresses all 4 channels in 2.  My workflow so far has been to use Final Cut Pro to transcode my images in ProRes with all 4 audio channels and then only put in first to edit.  Needless to say, I don't want to have to keep doing it this way.  Thanks for your help!

    Hello

    You will need to update your Adobe encoder support and Adobe prelude to the latest versions: 6.02. Update of the prelude was disclosed last week, and I believe that the SOUL is also available.

    This issue has been corrected in SOUL 6.02.

    You can update directly from each application via the menu or you can visit the page of each product on adobe.comhttp://adobe.com> and get the updates it.

    I hope this helps.

    Michael

    Sent from my iPhone

  • Typing becomes very slow in Firefox 3.6.11 in Mode safe mode with all extensions and plugins disabled.

    When I first start Firefox, all right. And everything is fine as long as I type in the text boxes on any web page. I can type in the address bar or search throughout the day with no problems.

    But, for example, just by typing in the edit box to ask this question on this site will result in the problem after I typed more say 150 characters. After this strike ANYWHERE in Firefox will be very slow, even the address bar or the search bar. It doesn't seem to matter what site use to type in the text. Cause the problem to occur after typing in enough strikes.

    Navigation & mouse clicking remains fast - it is only typing seems to be affected. In order to recover, I have to restart Firefox.

    If I look at the use of the UC Firefox.exe in Process Explorer, I see that once the problem occurs, the CPU usage starts whenever I type a key fortification. Indeed Firefox maxes one of my two hearts so the cpu is at 50%! He goes down to 0% again once I stop typing.

    As mentioned in the subject, it is in Mode safe mode with all extensions & plugins disabled. I'm running on Windows XP SP3 with an old AMD Athlon 64 X 2 Dual Core Processor 3800 + (1.81 Ghz) with 2.00 GB of RAM.

    I think it started to happen with Firefox 3.6 significantly (it's amazing how much time I can navigate without having to type), but it sometimes occurred with previous versions. Now he is annoyingly repeatable.

    I have to use '-no - Pei ForTyping distance "to start a separate session of Firefox that I use just to type in the text boxes, so I can restart at will. I also compose messages in an external editor and simply paste in Firefox to avoid typing as much as possible.

    This may be a problem with session restore. Firefox stores session data every 10 seconds to make it possible to restore a session crashed.

    It may be a problem with the sessionstore.js file in the profile folder

    Delete the sessionstore.js and sessionstore.bak and all files files sessionstore-# .js with a number in the left part of the name as sessionstore - 1.js.

    See http://kb.mozillazine.org/Session_Restore

  • Choose a high allpage of facebook and do only one page of facebook with all messages and friends

    My facebook log page came a few anonimosmalaway and I try remomve and date there. My faceboopage separated into four pages and

    I have a friend and member of my family on the individual page. And I don't know how when I go to close the page with log on and go to showt the PC in the form of four icons with facebook pages and an icon of such Microsoft fix it facebook.

    HI Los,

    What is the problem that face you?

    Operating system?

    Browsing using Internet Explorer? So what version?

    If this question is on facebook, then contact Facebook support.

  • How can I access MSN with digital images and records of the captain.

    How can I downloan on vist MSA workikng with digital camera

    I HAVE VISTA PACK 2... How DO to DOWNLOAD or ACCESS MSN WORKS WITH DIGITAL PHOTOS AND WORKING WITH PIX FILES? JMCULPEPPER

    Hello

    For the different Forums for Windows Live Applications, select the link below

    Welcome to Windows Live Solution Center

    http://windowslivehelp.com/

Maybe you are looking for