{"id":594,"date":"2012-10-29T16:48:51","date_gmt":"2012-10-29T16:48:51","guid":{"rendered":"http:\/\/sqlqueen.com\/?p=594"},"modified":"2012-10-29T16:48:51","modified_gmt":"2012-10-29T16:48:51","slug":"xcopy-batch-file","status":"publish","type":"post","link":"https:\/\/sqlkitty.com\/xcopy-batch-file\/","title":{"rendered":"xcopy batch file"},"content":{"rendered":"<p>https:\/\/ss64.com\/nt\/xcopy.html<\/p>\n<p>Simple backup batch file<\/p>\n<p>Note that long folder names must be enclosed in quotation marks.<br \/>\n@echo off<br \/>\nREM copy documents<br \/>\nxcopy &#8220;C:My Documents*.*&#8221; d:mirror \/c \/s \/r \/d \/y \/i &gt; d:mirrorxcopy.log<br \/>\nREM copy Outlook data<br \/>\nxcopy &#8220;C:Local SettingsApplication DataMicrosoftOutlookoutlook.pst&#8221; d:mirror \/c \/s \/r \/d \/y \/i &gt;&gt; d:mirrorxcopy.log<\/p>\n<p>As you can see in the sample code, Xcopy32 introduces many useful switches that didn\u2019t exist in its DOS predecessor. These are the most important ones:<br \/>\n\u2022\u00b7 \/d\u2014This switch copies all source files that are newer than existing destination files. It allows you to update only files that have changed, making the process a lot faster.<br \/>\n\u2022\u00b7 \/c\u2014This command-line option ignores errors. You don\u2019t want one corrupted file to halt the automated copying.<br \/>\n\u2022\u00b7 \/s\u2014This option copies directories and subdirectories.<br \/>\n\u2022\u00b7 \/r\u2014This switch copies read-only files.<br \/>\n\u2022\u00b7 \/y\u2014Use this switch to overwrite files without prompting. You don&#8217;t want any user intervention to be required.<br \/>\n\u2022\u00b7 \/i\u2014Use this option to automatically create new folders on destination.<\/p>\n<p>The &gt; d:mirrorxcopy.log suffix creates a log file with all of XCopy\u2019s messages, for later reference and troubleshooting. Using &gt;&gt; appends a file to an existing log rather than creating a new one.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/ss64.com\/nt\/xcopy.html Simple backup batch file Note that long folder names must be enclosed in quotation marks. @echo off REM copy documents xcopy &#8220;C:My Documents*.*&#8221; d:mirror \/c \/s \/r \/d \/y \/i &gt; d:mirrorxcopy.log REM copy Outlook data xcopy &#8220;C:Local SettingsApplication DataMicrosoftOutlookoutlook.pst&#8221; d:mirror \/c \/s \/r&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-594","post","type-post","status-publish","format-standard","hentry","category-network-administration"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>xcopy batch file - sqlkitty<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sqlkitty.com\/xcopy-batch-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"xcopy batch file - sqlkitty\" \/>\n<meta property=\"og:description\" content=\"https:\/\/ss64.com\/nt\/xcopy.html Simple backup batch file Note that long folder names must be enclosed in quotation marks. @echo off REM copy documents xcopy &#8220;C:My Documents*.*&#8221; d:mirror \/c \/s \/r \/d \/y \/i &gt; d:mirrorxcopy.log REM copy Outlook data xcopy &#8220;C:Local SettingsApplication DataMicrosoftOutlookoutlook.pst&#8221; d:mirror \/c \/s \/r&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlkitty.com\/xcopy-batch-file\/\" \/>\n<meta property=\"og:site_name\" content=\"sqlkitty\" \/>\n<meta property=\"article:published_time\" content=\"2012-10-29T16:48:51+00:00\" \/>\n<meta name=\"author\" content=\"Josephine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Josephine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/\"},\"author\":{\"name\":\"Josephine\",\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/#\\\/schema\\\/person\\\/dcaa92f5c45a54a9f5001475073ad27b\"},\"headline\":\"xcopy batch file\",\"datePublished\":\"2012-10-29T16:48:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/\"},\"wordCount\":223,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/#\\\/schema\\\/person\\\/dcaa92f5c45a54a9f5001475073ad27b\"},\"articleSection\":[\"network administration\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/\",\"url\":\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/\",\"name\":\"xcopy batch file - sqlkitty\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/#website\"},\"datePublished\":\"2012-10-29T16:48:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/xcopy-batch-file\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlkitty.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"xcopy batch file\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/#website\",\"url\":\"https:\\\/\\\/sqlkitty.com\\\/\",\"name\":\"sqlkitty\",\"description\":\"sql for everyone\",\"publisher\":{\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/#\\\/schema\\\/person\\\/dcaa92f5c45a54a9f5001475073ad27b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sqlkitty.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/#\\\/schema\\\/person\\\/dcaa92f5c45a54a9f5001475073ad27b\",\"name\":\"Josephine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/cropped-sqlkitty-greenbluecat-db.png\",\"url\":\"https:\\\/\\\/sqlkitty.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/cropped-sqlkitty-greenbluecat-db.png\",\"contentUrl\":\"https:\\\/\\\/sqlkitty.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/cropped-sqlkitty-greenbluecat-db.png\",\"width\":500,\"height\":306,\"caption\":\"Josephine\"},\"logo\":{\"@id\":\"https:\\\/\\\/sqlkitty.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/cropped-sqlkitty-greenbluecat-db.png\"},\"url\":\"https:\\\/\\\/sqlkitty.com\\\/author\\\/sqlkitty\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"xcopy batch file - sqlkitty","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sqlkitty.com\/xcopy-batch-file\/","og_locale":"en_US","og_type":"article","og_title":"xcopy batch file - sqlkitty","og_description":"https:\/\/ss64.com\/nt\/xcopy.html Simple backup batch file Note that long folder names must be enclosed in quotation marks. @echo off REM copy documents xcopy &#8220;C:My Documents*.*&#8221; d:mirror \/c \/s \/r \/d \/y \/i &gt; d:mirrorxcopy.log REM copy Outlook data xcopy &#8220;C:Local SettingsApplication DataMicrosoftOutlookoutlook.pst&#8221; d:mirror \/c \/s \/r&hellip;","og_url":"https:\/\/sqlkitty.com\/xcopy-batch-file\/","og_site_name":"sqlkitty","article_published_time":"2012-10-29T16:48:51+00:00","author":"Josephine","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Josephine","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlkitty.com\/xcopy-batch-file\/#article","isPartOf":{"@id":"https:\/\/sqlkitty.com\/xcopy-batch-file\/"},"author":{"name":"Josephine","@id":"https:\/\/sqlkitty.com\/#\/schema\/person\/dcaa92f5c45a54a9f5001475073ad27b"},"headline":"xcopy batch file","datePublished":"2012-10-29T16:48:51+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlkitty.com\/xcopy-batch-file\/"},"wordCount":223,"commentCount":0,"publisher":{"@id":"https:\/\/sqlkitty.com\/#\/schema\/person\/dcaa92f5c45a54a9f5001475073ad27b"},"articleSection":["network administration"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlkitty.com\/xcopy-batch-file\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlkitty.com\/xcopy-batch-file\/","url":"https:\/\/sqlkitty.com\/xcopy-batch-file\/","name":"xcopy batch file - sqlkitty","isPartOf":{"@id":"https:\/\/sqlkitty.com\/#website"},"datePublished":"2012-10-29T16:48:51+00:00","breadcrumb":{"@id":"https:\/\/sqlkitty.com\/xcopy-batch-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlkitty.com\/xcopy-batch-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sqlkitty.com\/xcopy-batch-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlkitty.com\/"},{"@type":"ListItem","position":2,"name":"xcopy batch file"}]},{"@type":"WebSite","@id":"https:\/\/sqlkitty.com\/#website","url":"https:\/\/sqlkitty.com\/","name":"sqlkitty","description":"sql for everyone","publisher":{"@id":"https:\/\/sqlkitty.com\/#\/schema\/person\/dcaa92f5c45a54a9f5001475073ad27b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sqlkitty.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/sqlkitty.com\/#\/schema\/person\/dcaa92f5c45a54a9f5001475073ad27b","name":"Josephine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlkitty.com\/wp-content\/uploads\/2021\/01\/cropped-sqlkitty-greenbluecat-db.png","url":"https:\/\/sqlkitty.com\/wp-content\/uploads\/2021\/01\/cropped-sqlkitty-greenbluecat-db.png","contentUrl":"https:\/\/sqlkitty.com\/wp-content\/uploads\/2021\/01\/cropped-sqlkitty-greenbluecat-db.png","width":500,"height":306,"caption":"Josephine"},"logo":{"@id":"https:\/\/sqlkitty.com\/wp-content\/uploads\/2021\/01\/cropped-sqlkitty-greenbluecat-db.png"},"url":"https:\/\/sqlkitty.com\/author\/sqlkitty\/"}]}},"_links":{"self":[{"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/posts\/594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/comments?post=594"}],"version-history":[{"count":0,"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/posts\/594\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/media?parent=594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/categories?post=594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlkitty.com\/wp-json\/wp\/v2\/tags?post=594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}