{"id":6600,"date":"2021-02-20T14:00:30","date_gmt":"2021-02-20T14:00:30","guid":{"rendered":"https:\/\/www.samlogic.net\/blog\/?p=6600"},"modified":"2021-05-10T19:30:04","modified_gmt":"2021-05-10T19:30:04","slug":"how-to-copy-move-many-files-at-once-in-visual-installers-script-language","status":"publish","type":"post","link":"https:\/\/www.samlogic.net\/blog\/2021\/02\/how-to-copy-move-many-files-at-once-in-visual-installers-script-language\/","title":{"rendered":"How to copy\/move many files at once in Visual Installer&#8217;s script language"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignright\" src=\"https:\/\/www.samlogic.net\/pad\/icons\/visual_installer.gif\" alt=\"\" border=\"0\">There is a built-in script language available in <a href=\"https:\/\/www.samlogic.net\/visual-installer\/visual-installer.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Visual Installer<\/a>. The script language is very versatile and with the script commands you can do different kind of file operations and other types of operations during an installation.<\/p>\n<p><img decoding=\"async\" class=\"alignright\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-visual-installer\/file-copy-operation-w400.png\" alt=\"File copy operation\" width=\"166\">One common operation is to copy or move files during an installation. There are commands available in Visual Installer&#8217;s script language that can do this. If you need to copy or move many files at once, you can use the <strong>MCOPY<\/strong> and <strong>MMOVE<\/strong> commands for this purpose. Below is the syntax of these two commands described:<\/p>\n<div style=\"background-color: #e8e8e8; padding: 8px;\"><span style=\"color: #000000; font-family: Arial; font-size: 15px;\"><strong>MCOPY %Source, %DestinationDir<\/strong><br \/>\nCopies many files at once. <em>%Source<\/em> specifies the source file path and <em>%DestinationDir<\/em> specifies the destination folder for the files.<\/p>\n<p><strong>MMOVE %Source, %DestinationDir<\/strong><br \/>\nMoves many files at once. <em>%Source<\/em> specifies the source file path and <em>%DestinationDir<\/em> specifies the destination folder for the files.<\/p>\n<p><\/span><\/div>\n<p>&nbsp;&nbsp;&nbsp;<br \/>\nYou can use <a href=\"https:\/\/en.wikipedia.org\/wiki\/Wildcard_character\" target=\"_blank\" rel=\"noopener noreferrer\">wildcards<\/a> with the <em>%Source<\/em> parameter. Example: &#8220;%DESTDIR\\Data\\*.txt&#8221;. The code examples below show how to use these two commands with wildcards etc.:<\/p>\n<p><strong>Example 1 &#8211; Copy many files at once<\/strong><br \/>\nCopies all files in the <em>%DESTDIR\\Data<\/em> folder to the <em>%DESTDIR\\NewPlace<\/em> folder:<\/p>\n<p><span style=\"color: #000000; font-family: Arial; font-size: 16px;\"><span style=\"color: #000080;\">MCOPY<\/span> <span style=\"color: #800000;\">%DESTDIR<\/span>\\Data\\*.*, <span style=\"color: #800000;\">%DESTDIR<\/span>\\NewPlace<\/span><\/p>\n<p><strong>Example 2 &#8211; Move many files at once<\/strong><br \/>\nMoves all text files in the <em>%DESTDIR\\Data<\/em> folder to the <em>%DESTDIR\\NewPlace<\/em> folder:<\/p>\n<p><span style=\"color: #000000; font-family: Arial; font-size: 16px;\"><span style=\"color: #000080;\">MMOVE<\/span> <span style=\"color: #800000;\">%DESTDIR<\/span>\\Data\\*.txt, <span style=\"color: #800000;\">%DESTDIR<\/span>\\NewPlace<\/span><\/p>\n<div style=\"background-color: #e8e8e8; padding: 8px;\"><span style=\"color: #000000; font-family: Arial; font-size: 15px;\">To add script commands to an installation, you need to open the <strong>Special &#8211; Execute script commands<\/strong> menu item in Visual Installer&#8217;s editor. More information is available in this <a href=\"https:\/\/www.samlogic.net\/visual-installer\/tips\/tips-pages\/visual-installer-scripting-language\/visual-installer-scripting-language.htm\" target=\"_blank\" rel=\"noopener noreferrer\">tip<\/a>.<\/span><\/div>\n<p>&nbsp;&nbsp;&nbsp;<br \/>\n<strong>More information<\/strong><br \/>\nFor more information about Visual Installer&#8217;s script language, see this web page:<\/p>\n<p><span style=\"color: #ff0000;\">&gt;<\/span> <a href=\"https:\/\/www.samlogic.net\/visual-installer\/tips\/index-tips-tricks-visual-installer-page-2.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Advanced Tips &amp; Tricks for SamLogic Visual Installer<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a built-in script language available in Visual Installer. The script language is very versatile and with the script commands you can do different kind of file operations and other types of operations during an installation. One common operation is to copy or move files during an installation. There are commands available in Visual &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.samlogic.net\/blog\/2021\/02\/how-to-copy-move-many-files-at-once-in-visual-installers-script-language\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to copy\/move many files at once in Visual Installer&#8217;s script language&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"_links":{"self":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/6600"}],"collection":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/comments?post=6600"}],"version-history":[{"count":57,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/6600\/revisions"}],"predecessor-version":[{"id":6749,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/6600\/revisions\/6749"}],"wp:attachment":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/media?parent=6600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/categories?post=6600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/tags?post=6600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}