{"id":6279,"date":"2020-02-16T14:00:53","date_gmt":"2020-02-16T14:00:53","guid":{"rendered":"https:\/\/www.samlogic.net\/blog\/?p=6279"},"modified":"2020-02-16T23:40:11","modified_gmt":"2020-02-16T23:40:11","slug":"how-to-delay-deletion-of-a-file-until-reboot","status":"publish","type":"post","link":"https:\/\/www.samlogic.net\/blog\/2020\/02\/how-to-delay-deletion-of-a-file-until-reboot\/","title":{"rendered":"How to delay deletion of a file until reboot"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignright\" src=\"https:\/\/www.samlogic.net\/pad\/icons\/visual_installer.gif\" alt=\"\" border=\"0\">Sometimes a file need to be deleted during an installation, but it can not be done because of the file is active and locked by the system. To handle this we have added a new script command to <a href=\"https:\/\/www.samlogic.net\/visual-installer\/visual-installer.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Visual Installer<\/a> with the name <strong>RDELETE<\/strong> that can be used to mark a file for deletion and let the system delete the file when the computer restarts.<\/p>\n<p>When you use this command, no attempt will be made to delete the file during the installation. Instead Visual Installer will inform the system that the file need to be deleted during the next system reboot.<\/p>\n<p>The command syntax is the following:<\/p>\n<p><strong><span style=\"font-size: 17px; font-family: 'Courier New', 'Arial';\">RDELETE <em>filepath<\/em><\/span><\/strong><\/p>\n<p>Example:<\/p>\n<p><strong><span style=\"font-size: 17px; font-family: 'Courier New', 'Arial';\"><span style=\"color: #000080;\">RDELETE<\/span>&nbsp;<span style=\"color: #800000;\">%DESTDIR<\/span>\\CleanUp\\CleanUp.exe<\/span><\/strong><\/p>\n<p>This command is useful when a file need to be deleted, but there is no hurry to delete the file. You can then call this command and let the system delete it later.<\/p>\n<p><strong><span style=\"font-size: 17px;\">See also<\/span><\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">&gt;<\/span><\/strong> <a href=\"https:\/\/www.samlogic.net\/visual-installer\/tips\/tips-pages\/delete-files-from-script\/delete-files-from-script.htm\" target=\"_blank\" rel=\"noopener noreferrer\">4 delete commands available in the script language &#8211; when to use which<\/a><br \/>\n<strong><span style=\"color: #ff0000;\">&gt;<\/span><\/strong> <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\">Visual Installer&#8217;s Scripting Language<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes a file need to be deleted during an installation, but it can not be done because of the file is active and locked by the system. To handle this we have added a new script command to Visual Installer with the name RDELETE that can be used to mark a file for deletion and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.samlogic.net\/blog\/2020\/02\/how-to-delay-deletion-of-a-file-until-reboot\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to delay deletion of a file until reboot&#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":[10,15],"tags":[],"_links":{"self":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/6279"}],"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=6279"}],"version-history":[{"count":21,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/6279\/revisions"}],"predecessor-version":[{"id":6303,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/6279\/revisions\/6303"}],"wp:attachment":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/media?parent=6279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/categories?post=6279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/tags?post=6279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}