Tag Info

Hot answers tagged

48

See Robocopy /? Usage : ROBOCOPY source destination [file [file]...] [options] robocopy c:\folder d:\folder transfer_this.txt


32

It's a SID, or Security Identifier. If it's showing the string rather than a "friendly name," it sounds like the new server doesn't recognize the account.


27

So for this you can harken back to your DOS days (if you had them) and utilize the 8.3 naming convention, which gets around the invalid NTFS security descriptors that aren't there. Steps to remove the invalid new destination folders: Open a command prompt with admin rights to the root folder where these new folders are listed. Use the command DIR /X to ...


16

Have you tried using the /R and /W switches? Something like: /R:2 /W:2 This means retry twice wait 2 secs to retry. If the file is still open after the two attempts, the file will be skipped. Depending on your needs you could lower it to /R:1 /W:1.


16

Take a look at the options for the /COPY:[copyflags] and /DCOPY switches. As per the ROBOCOPY /? usage info: /COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT). (copyflags : D=Data, A=Attributes, T=Timestamps). (S=Security=NTFS ACLs, O=Owner info, U=aUditing info). /DCOPY:T :: COPY Directory ...


14

Populating strings into parameters for external commands from within Powershell requires some hoop jumping if you want to be able to use variable expansion and also have the resulting command line properly understand which parameters you want to be separated and which should not. In your example you are sending the entire string as the first parameter and ...


10

You must include the full path (including the drive) to the file to exclude. Relative paths won't work. This works: robocopy folder1 destination /E /XF "c:\somedir\another dir\folder1\help.txt" This doesn't: robocopy folder1 destination /E /XF "folder1\help.txt" Nor does this: robocopy folder1 destination /E /XF ".\folder1\help.txt"


8

Any command-line utility can be made completely silent by redirecting stdout and stderr to the special file 'nul'. This is Windows' equivalent to /dev/null on *nix systems. command >nul (stdout is not echoed) command 2>nul (stderr is not echoed) command >nul 2>&1 (neither stdout nor stderr is echoed) The latter is the one you want to ...


8

I have been trying to do the same from a network share. SET MoveDirSource=\\Server\Folder SET MoveDirDestination=Z:\Folder Here are my findings and solution from tests on a Windows 7 machine. Suggestion: ROBOCOPY "%MoveDirSource%" "%MoveDirDestination%" /MOVE /E Problem: Moves source folder. Suggestion: ROBOCOPY "%MoveDirSource%" ...


8

Turns out the /XD matches on the directory name -- not the full path. So you don't actually have to worry about matching the backslashes. So to exclude directories (anywhere in the path) called "bar", a simple /XD bar will work. If you wanted to exclude "barf", too, you could use /XD bar*. Sometimes the answer is simpler than you think.


7

I've performed file-level clones (using the Linux NTFS Tools ntfsclone utility) of Windows 2000 and Windows XP. I haven't tried ntfsclone with Windows Vista or newer versions but I wouldn't expect any problems. I use Microsoft's file-level cloning tool, ImageX, quite regularly with Windows XP and Windows 7 and have no problems there, either. I generally ...


7

Set your expectations low. If anything robocopy then copied was written over the 'deleted' data, you will lose it. I've never used the software you mention but I have done a small amount of recovery and the best tools I found were often designed towards certain formats. For example 'photorec' was great when I wanted to get tens of thousands of jpegs ...


6

Instead of using a mapped drive letter, use the UNC path of the share (\\servername\sharename\folder). That'll simplify things since your mapped drives are associated with your session, not necessarily the session that the scheduled task runs in. Next, ensure that the user associated with the scheduled task has access to that share. That should get you ...


6

Is there some reason you are not providing a UNC to robocopy? I find that using a UNC is much more reliable then depending on a mapped drive in a scheduled task.


6

On my system (Vista), powershell shows the c:\ drive as having both hidden and system attributes set. PS C:\Users\michael.DOMAIN> Get-Item c:\ Directory: Mode LastWriteTime Length Name ---- ------------- ------ ---- d--hs 8/18/2009 12:19 PM <DIR> C:\ After copying the files, you can use ...


6

The version of robocopy that is included with Server 2008 does not include the security attributes when you use the /MIR option. You have one of two options: Install the version from the Server 2003 Resource Kit (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17657) and command you already have. Run the command you already have and ...


6

Excluding subfolders is actually the default behavior of robocopy, or at least the version that comes with Windows 7. (In order to copy the sub-directories you would have to add the /S or /E option to the command.) So, you can just use robocopy source-folder target-folder.


6

A simple solution might be to use something like disk2vhd. This will create a VHD file, which a drive image format that is compatible with Hyper-V, and can also be directly mounted on Windows 7/2008 R2 and above. VHD files can also be converted so you could boot into a VM compatible with Vmware hypervisors, Virtual box and other popular visualization ...


5

There is a limit on command line length (I think it is something like 2048 characters) in windows. You should generate a job file with a small subset of the exclusion list specified (using the /save:filename argument) to get the syntax, edit the file to include the full list, and then use the /job:filename argument to run it. For reference, the ...


5

Finally something people didn't answer in 10 seconds! I used your issue to continue to learn more about Powershell. The following works for me, I hope to see how others will slim down this code: Clear-Host $ErrorActionPreference = "Continue" $DebugPreference = "Continue" $VerbosePreference = "Continue" @" ## robocopy_helper.ps1 ...


5

The parameter /sec needs to be added to your command-line. This will cause the /mir to copy security attributes. However, you really, really want to do that to a fresh target. Because of how robocopy works, it'll apply security settings to a directory and then proceed to copy in the child contents. This way those children get their inherited rights ...


5

In general, the BEGIN BACKUP / END BACKUP block would signal Exchange to truncate the logs. But in order for it to work, you should have created a snapshot of all volumes with Exchange-related data - so if you have separated data and transaction logs, you would need to snapshot both - the data and the Tlog volume. Also, you should make sure that your script ...


5

Whether it's RoboCopy or some other method, I prefer to log all output and then post-process the log. I personally prefer Perl for that task but use whatever you're comfortable with. I aslo like to have the test checking script email me the results, showing just whether it succeeded or in the case of a failure the relevant lines from the log. In my opinion, ...


5

The /MOV option is designed to do exactly that. Check your specific version of robocopy for it (robocopy /? should show the option).


5

Have you tried the /MOV option? /MOV :: MOVe files (delete from source after copying). F:>robocopy /? ROBOCOPY :: Robust File Copy for Windows Started : Fri Aug 06 11:51:26 2010 Usage :: ROBOCOPY source destination [file [file]...] [options] source :: Source Directory (drive:\path or \\server\share\path). ...


4

You can do this by creating a placeholder file in the directory you don't want to delete, and then instructing robocopy to exclude the file using /XF Since the file is excluded, it won't get moved, and the directory won't get deleted. For details, see that other site: http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_24306678.html ...


4

I use rsync for Windows to copy over broadband connection. It is supposedly a delta copy system which only copies over the changes of each file whereas robocopy copies over the whole file if it has changed one bit. (tbh I wonder sometimes whether it actually does this) You could also use robocopy /mon:x switch and have it permanently running. This will run ...


4

Try adding /MT and removing /Z. This worked like a charmm for me:)


4

It has to do with copying the hidden/system System Volume Information from the root of a disk - if it gets copied, the target directory gets the same attributes system/hidden. Creating the directory before copying does not help as robocopy will hide it too. Add the /A-:SH switch to ignore system files. More information in this Microsoft Technet ...



Only top voted, non community-wiki answers of a minimum length are eligible