Hot answers tagged

75

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


34

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 ...


23

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 ...


18

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.


17

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 ...


11

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"


11

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.


10

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%" "%...


9

The command you mentioned is fine and almost reaches the goal you've set. If you really would like to perform the 1:1 migration, I would suggest you to consider following options: robocopy "\\Source server\folder\" "\\Target server\folder\" /MIR /COPY:DATSOU /ZB /R:1 /W:10 /TEE /log:<log path.txt> /MIR - this will MIRror a directory tree - whatever ...


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 ...


7

According to the Wikipedia article on Robocopy: Folder copier, not file copier Robocopy syntax is markedly different from standard copy commands, as it accepts only folder names as its source and destination arguments. File names and wild-card characters (such as ".*") *are not valid source or destination arguments. Files may be selected or excluded ...


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 ...


7

These switches worked for me: /NFL : No File List - don't log file names. /NDL : No Directory List - don't log directory names. /NJH : No Job Header. /NJS : No Job Summary.'


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 don'...


7

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 ...


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

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

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


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 tools....


6

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

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 discussion....


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). ...


5

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 ...


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 correctly....


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 ...



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