{"id":92882,"date":"2016-01-19T07:00:00","date_gmt":"2016-01-19T22:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=92882"},"modified":"2019-03-13T10:29:07","modified_gmt":"2019-03-13T17:29:07","slug":"20160119-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20160119-00\/?p=92882","title":{"rendered":"What makes XCOPY so X?"},"content":{"rendered":"<p>There&#8217;s <code>COPY<\/code> and there&#8217;s <code>XCOPY<\/code>. First things first: I don&#8217;t know what the X stands for. Extra? Exorbitant? Excellent? My guess is Extended, but it&#8217;s just a guess. <\/p>\n<p>The built-in MS-DOS <code>COPY<\/code> command copied one file at a time. This was a real pain if you wanted to copy a bunch of files from one floppy disk to another, and you had a single-floppy machine. Copying all the files from one disk to another went like this: <\/p>\n<ul>\n<li>You type <code>COPY A:*.* B:<\/code> \n<li>The <code>COPY<\/code> command reads <code>FILE1.TXT<\/code> into memory. \n<li>You are then told\n<pre>\nInsert diskette for drive B: and press any key to continue.\n<\/pre>\n<li>You swap disks and press a key. \n<li>The <code>COPY<\/code> command writes <code>FILE1.TXT<\/code>     to the destination disk. \n<li>You are then told\n<pre>\nInsert diskette for drive A: and press any key to continue.\n<\/pre>\n<li>You swap disks and press a key. \n<li>The <code>COPY<\/code> command reads <code>FILE2.TXT<\/code> into memory. \n<li>You are then told\n<pre>\nInsert diskette for drive B: and press any key to continue.\n<\/pre>\n<li>You get the idea. <\/ul>\n<p>This gets really annoying if you are copying a bunch of small files, because you have to swap disks after every single file. <\/p>\n<p>Enter <code>XCOPY<\/code>. <\/p>\n<p>The <code>XCOPY<\/code> program improves upon the built-in <code>COPY<\/code> command by reading as many files from the source as will fit into memory before asking you to swap disks. Then it would write out everything before asking you to put the original disk back in. If you had a lot of memory (like 256KB), you could read the entire floppy disk into RAM, and then write it all out. Boom, your files are copied with only a single disk swap. <\/p>\n<p>This fancy file copying was in a separate program because adding it to the core <code>COMMAND.COM<\/code> would have made it too big. (It is to the command processor&#8217;s advantage to stay small so that it could remain in the transient program area and avoid having to be reloaded.) <\/p>\n<p> As a result, there was a special wrinkle: Since <code>XCOPY.EXE<\/code> is a separate program, how do you copy files between two floppy disks, neither of which have a copy of <code>XCOPY.EXE<\/code> on them? <\/p>\n<p>That&#8217;s where the <code>\/W<\/code> option comes in. I&#8217;m guessing that the W stands for &#8220;wait&#8221;: It makes <code>XCOPY<\/code> wait for a keypress before starting to copy files. This gives you a chance to remove the floppy that has <code>XCOPY<\/code> and insert the disk containing the files you want to copy. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s extra awesome. But I don&#8217;t know what the X stands for.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2],"class_list":["post-92882","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>It&#8217;s extra awesome. But I don&#8217;t know what the X stands for.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/92882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=92882"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/92882\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=92882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=92882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=92882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}