Tag Info

Hot answers tagged

12

Your question sounds like you want the first 10 files from every subfolder? This ought to do it (not exhaustively tested!): echo off xcopy /Y %1 %2 /T /E dir %1 /b /s /A:D >tempfolderlist.txt for /f "tokens=1 delims=¬" %%a in (./tempfolderlist.txt) do ( dir "%%a" /b /A:-D >tempfilelist.txt setlocal enabledelayedexpansion set counter=0 ...


11

From a performance standpoint only, xcopy or robocopy will give you similar results. I ran through a couple of tests on a Windows Vista 64-bit SP2 box to do some comparisons. All copies were performed between a internal 7200 RPM Sata II disk and an external USB 2.0 drive or on the same internal drive itself where indicated. No special setup was done (make up ...


7

RoboCopy is a command line tool provided by Microsoft that can do mirroring. The Wiki page also mentions a GUI.


6

Robocopy has far more options and is built in on most recent Windows versions. robocopy source-dir destination-dir filespec /E /XC /XN /XO This will only copy across files that meet filespec (e.g. *.avhd in your example) from source dir (c:\Hyper-V\vhd in your example) to destdir (z:\backup\hyperv_vms). The switches tell it to skip older, newer and ...


5

What is the cluster size (allocation unit size) on your source volume D (actually on the filesystem inside your TrueCrypt container) and on your target volume F? One hypothesis for the drive filling up, is that volume F has a larger cluster size, and volume D has many small files. This would mean that the same data could take up significantly more space on ...


4

Robocopy is your friend in this. It has a flag that'll do exactly what you want. robocopy c:\ f:\ /mir /r:1 /sec That'll do a mirror copy, retrying open files once before moving on, and will also copy security. The mirror copy will also remove files from F:\ that no longer exist on C:\, which is something xcopy can't do. Also, after the first sync it'll ...


4

I typically use: robocopy source dest /E /MIR or some other variant of the parameters - perhaps /NFL /NDL /NS /NC /NP to match the "quiet"


4

Sounds like you want Logon scripts


2

The /M parameter tells it to copy only files with the "Archive" attribute set, and resets that attribute at the same time. The "archive" bit is a part of the file system, like the "Read Only" bit or the "System file" bit. It was traditionally used for old-fashioned "naive" backup software so that it could tell whether or not a file had been changed since it ...


2

I use xcopy /d /e /c /k /y /v /o which provides no prompting and doesn't overwrite existing files if the source is the same date as the destination.


2

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


2

I would use rsync for this purpose. You can download a Windows-compatible binary or get it as part of Cygwin (I recommend the former approach unless you already have Cygwin installed). You can either push files to the remote site or pull from it. I prefer the pull method, but either will do. Using the pull method, the rsync daemon will run on the source ...


2

If you only want the first 10 files out of the whole structure, you could use this (heavily borrowed from Owen's answer!) @echo off mkdir %2 dir %1 /b /s /A:-D >tempfilelist.txt setlocal enabledelayedexpansion set counter=0 for /f "tokens=1 delims=¬" %%b in (./tempfilelist.txt) do ( IF !counter! LSS 10 call :docopy "%%b" %2 set /a ...


2

For something that old, running on Windows 2003 (I assume) I'd probably go with robocopy or something similar. For Windows 2008 servers I use DFS between the servers (for the sites that need it like WordPress). For sites that where all files are pushed by a sysadmin we just push to each server manually so we keep pull one server out of the load balencer at ...


2

Solution to your problem is to use different subnet for the second interface than the interface used to connect the application server. So that both the communications i.e source to application server and source to database server will be isolated from each other.


1

OK, if I put the batch file in C:\users\ then for /D %%a IN (*) do call robocopy %%a\ f:\%%a\ *.txt /mir /r:1 /sec works


1

Let's break it down. You want to copy the My Documents folder and all its contents to some location. Groovy. Folder Redirection (/Offline Files) via Group Policy isn't how you're going about it, though. Fair enough; it's not for everyone. But there are a ton of assumptions built into your script, and there's probably easier ways of doing it. Instead, you ...


1

For one thing, maybe it's because of the superfluous '\*' in the first xcopy argument. Again, using Documents might help, because 'My Documents' is just a junction point to 'Documents', only for backward compatibility with some limitations, e.g. you can't dir in it.


1

I suspect it's the /O - the users probably don't have the rights to modify the NTFS ACLs on the target.


1

It seems that error 4 means: "Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line." EDIT: Microsoft's page on XCOPY


1

I suspect the difference lay in date resolution differences as reported by Samba and as stored in the file-system. It could be that Samba is reporting dates with the micro-seconds zeroed, where the file-system is storing microseconds, and xcopy/robocopy care about that. Without cracking open a sniffer I can't prove it, but it is a guess.


1

That web deployment tool is good! Disclosure: MSFT employee, clearly biased! The Web Deployment Tool can migrate sites and apps between servers, and has some really useful features for determining whether configuration has drifted between servers within a farm. Generally, you -verb:sync content into a package of some sort, then you can -verb:sync or ...


1

I found RichCopy, with it's native multi-threading to be extremely fast...


1

One way I have gotten past this error is to use runas. If you have access to a command line, then use /runas:<domain>\<domainadmin> cmd.exe. You will get a second command line that runs with domain admin credentials. (Note: to perform on windows 7, you may have to elevate past the UAC.) Once you have your domain admin command line, continue on ...


1

Is it possible you have Windows firewall (or a 3rd party firewall) enabled that is blocking the WMI call? Port 135 needs to be open for WMI to work properly. See this article for details about connecting WMI through a firewall. Edit: I did some more digging about this - you problem is how WMIC uses your credentials when it tries to connect to networkPC. ...


1

One school of thought would say that if the file is corrupt anyway, all that a backup of it would give you is the ability to restore some corruption, so using the /C switch on xcopy is a viable approach. You should be aware however that xcopy can occasionally misreport a corruption on what is a perfectly good file. One place I've definitely seen this ...


1

You say the source and destination are on the same drive, but are they both on the build server? If the build server is the location of the source and destination, consider moving one folder or the other to another drive, maybe on another controller. If the build server is not the location of the source and destination (build drops are not always on the ...


1

I use XCopy for the same purpose. What I also did was added another NIC to that server and put it on a separate subnet. Then made a direct connection to the server I am transferring files from. That way the 2 machines are moving the copied data via one subnet and users can still access via the second nic which is connected directly to the LAN.



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