{"id":4734,"date":"2017-05-31T12:00:26","date_gmt":"2017-05-31T11:00:26","guid":{"rendered":"http:\/\/www.samlogic.net\/blog\/?p=4734"},"modified":"2019-07-07T17:36:08","modified_gmt":"2019-07-07T17:36:08","slug":"cd-menu-creator-using-wildcard-characters-in-a-file-path","status":"publish","type":"post","link":"https:\/\/www.samlogic.net\/blog\/2017\/05\/cd-menu-creator-using-wildcard-characters-in-a-file-path\/","title":{"rendered":"CD-Menu Creator: Using wildcard characters in a file path"},"content":{"rendered":"<p>Normally you create a link between a menu button and a specific file on the disc or USB stick by specifying a file path to the file. For example: &#8216;<strong>Files\\Button1\\MyDoc.doc<\/strong>&#8216;. When a user clicks on the button, the file (in this case &#8216;<strong>Files\\Button1\\MyDoc.doc<\/strong>&#8216;) will be opened.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-cd-menu-creator\/cdmc-editor-dialogbox-add-button--filepath.png\" alt=\"The 'Add Button'dialog box (example 1)\" border=\"0\"><\/p>\n<p>If the filename must be changed, for any reason, the whole menu must be created again when this technique is used. Otherwise the file will not be found when the user clicks on the button.<\/p>\n<p><img decoding=\"async\" class=\"alignright\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-cd-menu-creator\/wildcard-asterisk-w122.png\" alt=\"asterisk\" border=\"0\">But starting with version <strong>8.5.3<\/strong> of <a href=\"https:\/\/www.samlogic.net\/cd-menu-creator\/cd-menu-creator.htm\" target=\"_blank\" rel=\"noopener noreferrer\">CD-Menu Creator<\/a>, an alternative method can be used. Instead of specifying a file path to one specific file, for example &#8216;<strong>Files\\Button1\\MyDoc.doc<\/strong>&#8216;, you can use a wildcard character (an asterisk: <strong>*<\/strong>) and specify a file path to the first occurrence of a file in a folder with a specified filename extension, for example &#8216;<strong>Files\\Button1\\*.doc<\/strong>&#8216;. In this case the first file in the &#8216;<strong>Files\\Button1<\/strong>&#8216; folder that has a &#8216;<strong>.doc<\/strong>&#8216; filename extension in its filename will be opened.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-cd-menu-creator\/cdmc-editor-dialogbox-add-button--wildcard-character-asterisk.png\" alt=\"The 'Add Button'dialog box (example 2)\" border=\"0\"><\/p>\n<p>This technique allows you to change the filename of the file in the folder without re-creating the whole menu. The filename extension must be the same, but the rest of the filename can be changed freely on the CD\/DVD\/USB stick.<\/p>\n<p><strong>Works with documents and programs<\/strong><br \/>\nThis technique with a wildcard character can be used with the following three button commands:<\/p>\n<p><span style=\"color: #800000;\"><strong>Run Program<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"> <strong>Run Program &amp; Close<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"> <strong>Show Document<\/strong><\/span><\/p>\n<p><strong>Filename examples<\/strong><br \/>\nBelow are some examples of how filenames can be built when using this technique:<\/p>\n<p><span style=\"color: #707070;\">&#8216;<strong>MyDoc1.doc<\/strong>&#8216;<\/span><br \/>\n<span style=\"color: #707070;\"> &#8216;<strong>MyDoc2.doc<\/strong>&#8216;<\/span><br \/>\n<span style=\"color: #707070;\"> &#8216;<strong>LatestNews-20170528.doc<\/strong>&#8216;<\/span><br \/>\n<span style=\"color: #707070;\"> &#8216;<strong>LatestNews-20170529.doc<\/strong>&#8216;<\/span><br \/>\n<span style=\"color: #707070;\"> &#8216;<strong>Journal-John-Smith.doc<\/strong>&#8216;<\/span><br \/>\n<span style=\"color: #707070;\"> &#8216;<strong>Journal-Sam-Johnson.doc<\/strong>&#8216;<\/span><\/p>\n<p><strong>File path examples<\/strong><br \/>\nBelow are some examples of how the file path can be built:<\/p>\n<p><span style=\"color: #707070;\">&#8216;<strong>Files\\Button1\\*.doc<\/strong>&#8216;<\/span><br \/>\n<span style=\"color: #707070;\"> &#8216;<strong>Files\\Button2\\*.xls<\/strong>&#8216;<\/span><br \/>\n<span style=\"color: #707070;\"> &#8216;<strong>Files\\Button3\\*.exe<\/strong>&#8216;<\/span><\/p>\n<p><span style=\"color: #707070;\"> &#8216;<strong>Files\\Button4\\journal*.doc<\/strong>&#8216;<\/span><br \/>\n<span style=\"color: #707070;\"> &#8216;<strong>Files\\Button5\\app*.exe<\/strong>&#8216;<\/span><\/p>\n<p>An asterisk (<strong>*<\/strong>) is the only supported wildcard character. The asterisk must always be to the left of the dot that starts the filename extension.<\/p>\n<p><strong>Tip<\/strong><br \/>\nWhen you create your menu for the first time, it can be a good idea to first select a source file and specify a complete file path to this file (do not use wildcards yet). After you have created your menu and everything works as expected with the selected file, you can change the file path to a file path that contains a wildcard character. Then you create your menu again. Henceforth you can change the filename of the file freely directly in the folder on disc or USB stick. You don&#8217;t need to create the menu again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Normally you create a link between a menu button and a specific file on the disc or USB stick by specifying a file path to the file. For example: &#8216;Files\\Button1\\MyDoc.doc&#8216;. When a user clicks on the button, the file (in this case &#8216;Files\\Button1\\MyDoc.doc&#8216;) will be opened. If the filename must be changed, for any reason, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.samlogic.net\/blog\/2017\/05\/cd-menu-creator-using-wildcard-characters-in-a-file-path\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;CD-Menu Creator: Using wildcard characters in a file path&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,15],"tags":[],"_links":{"self":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/4734"}],"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=4734"}],"version-history":[{"count":1,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/4734\/revisions"}],"predecessor-version":[{"id":6019,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/4734\/revisions\/6019"}],"wp:attachment":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/media?parent=4734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/categories?post=4734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/tags?post=4734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}