{"id":102,"date":"2007-03-30T09:00:00","date_gmt":"2007-03-30T17:00:00","guid":{"rendered":"http:\/\/testblog.sapien.com\/index.php\/2007\/03\/30\/the-final-choice\/"},"modified":"2007-03-30T09:00:00","modified_gmt":"2007-03-30T17:00:00","slug":"the-final-choice","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/","title":{"rendered":"The Final Choice"},"content":{"rendered":"<p>Let&#8217;s wrap up our look at CHOICE.EXE and how to use it in batch files. I&#8217;ve shown you some basic examples but CHOICE has a few &#8220;advanced&#8221; features you might want to incorporate into your batch file.<\/p>\n<p>As I&#8217;ve explained before, menu choices by default are case-insensitive. However, you can enforce a case-sensitive choice with the \/CS switch:<\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">@echo off<br \/>echo a = Lower Case choice<br \/>echo A = Upper case choice<br \/>Choice \/c &#8220;aA&#8221; \/CS \/M &#8220;Make a choice&#8221; <\/font><\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">if errorlevel 2 GOTO :Upper<br \/>if errorlevel 1 GOTO :Lower<br \/>GOTO :EOF <\/font><\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">:Upper<br \/>echo Upper Case choice<br \/>GOTO :EOF <\/font><\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">:Lower<br \/>echo Lower Case choice<br \/>GOTO :EOF <\/font><\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">:EOF<\/font> <\/p>\n<p>The user&#8217;s choices are &#8220;a&#8221; or &#8220;A&#8221;. Again, the script jumps to the appropriate section depending on what was selected. <\/p>\n<p>There may be times in your batch file where you want to provide a menu choice, but don&#8217;t want to wait indefinitely. For those situations you will use a combination of \/T to specify a timeout value in seconds between 0 and 9999,&nbsp;and \/D to indicate the default value. The \/D value must be one of the options listed with \/C. <\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">@echo off<br \/>Choice \/T 5 \/D Y \/M &#8220;Do you want to continue?&#8221; <\/font><\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">if errorlevel 2 GOTO :NO<br \/>if errorlevel 1 GOTO :YES<br \/>GOTO :EOF <\/font><\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">:NO<br \/>echo Not continuing<br \/>GOTO :EOF <\/font><\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">:YES<br \/>echo Continuing<br \/>GOTO :EOF <\/font><\/p>\n<p><font style=\"color: #0000ff\" face=\"Lucida Console\" color=\"#0000ff\" size=\"2\">:EOF<\/font><\/p>\n<p>This prompt will wait for 5 seconds for the user to make a choice. If they don&#8217;t respond by then, the script will force the default choice of Y which will evaulated just as if the user had typed Y at the choice prompt. <br \/>By now you should have enough information and samples on how to incorporate CHOICE into your batch files. If you ever forget the options, simpy run CHOICE \/? at a command prompt for syntax help. <\/p>\n<p>&nbsp;<\/p>\n<div class=\"wlWriterSmartContent\" id=\"0767317B-992E-4b12-91E0-4F059A8CECA8:83ce4693-13bd-4c78-881f-148d88247d3b\" style=\"padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px\"><span class=\"sizeLess20\">Technorati tags: <\/span><a href=\"http:\/\/technorati.com\/tags\/CMD\" rel=\"tag\"><span class=\"sizeLess20\">CMD<\/span><\/a><span class=\"sizeLess20\">, <\/span><a href=\"http:\/\/technorati.com\/tags\/choice\" rel=\"tag\"><span class=\"sizeLess20\">choice<\/span><\/a><span class=\"sizeLess20\">, <\/span><a href=\"http:\/\/technorati.com\/tags\/Commandline\" rel=\"tag\"><span class=\"sizeLess20\">Commandline<\/span><\/a><span class=\"sizeLess20\">, <\/span><a href=\"http:\/\/technorati.com\/tags\/Batch\" rel=\"tag\"><span class=\"sizeLess20\">Batch<\/span><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s wrap up our look at CHOICE.EXE and how to use it in batch files. I&#8217;ve shown you some basic examples but CHOICE has a few &#8220;advanced&#8221; features you might want to incorporate into your batch file.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[18],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-batchcmd"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Let\u2019s wrap up our look at CHOICE.EXE and how to use it in batch files. I\u2019ve shown you some basic examples but CHOICE has a few \u201cadvanced\u201d features you might want to incorporate into your batch file.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Jeffery Hicks\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"DEV SAPIEN Blog - Tools for IT Success\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"The Final Choice - DEV SAPIEN Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Let\u2019s wrap up our look at CHOICE.EXE and how to use it in batch files. I\u2019ve shown you some basic examples but CHOICE has a few \u201cadvanced\u201d features you might want to incorporate into your batch file.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2007-03-30T17:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2007-03-30T17:00:00+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"The Final Choice - DEV SAPIEN Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Let\u2019s wrap up our look at CHOICE.EXE and how to use it in batch files. I\u2019ve shown you some basic examples but CHOICE has a few \u201cadvanced\u201d features you might want to incorporate into your batch file.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/#blogposting\",\"name\":\"The Final Choice - DEV SAPIEN Blog\",\"headline\":\"The Final Choice\",\"author\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/author\\\/jeffery-hicks\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/#organization\"},\"datePublished\":\"2007-03-30T09:00:00-07:00\",\"dateModified\":\"2007-03-30T09:00:00-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/#webpage\"},\"articleSection\":\"Batch\\\/CMD\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dev.sapien.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/topics\\\/batchcmd\\\/#listItem\",\"name\":\"Batch\\\/CMD\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/topics\\\/batchcmd\\\/#listItem\",\"position\":2,\"name\":\"Batch\\\/CMD\",\"item\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/topics\\\/batchcmd\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/#listItem\",\"name\":\"The Final Choice\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/#listItem\",\"position\":3,\"name\":\"The Final Choice\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/topics\\\/batchcmd\\\/#listItem\",\"name\":\"Batch\\\/CMD\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/#organization\",\"name\":\"DEV SAPIEN Blog\",\"description\":\"Tools for IT Success\",\"url\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/author\\\/jeffery-hicks\\\/#author\",\"url\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/author\\\/jeffery-hicks\\\/\",\"name\":\"Jeffery Hicks\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/#webpage\",\"url\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/\",\"name\":\"The Final Choice - DEV SAPIEN Blog\",\"description\":\"Let\\u2019s wrap up our look at CHOICE.EXE and how to use it in batch files. I\\u2019ve shown you some basic examples but CHOICE has a few \\u201cadvanced\\u201d features you might want to incorporate into your batch file.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/2007\\\/03\\\/30\\\/the-final-choice\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/author\\\/jeffery-hicks\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/author\\\/jeffery-hicks\\\/#author\"},\"datePublished\":\"2007-03-30T09:00:00-07:00\",\"dateModified\":\"2007-03-30T09:00:00-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/\",\"name\":\"DEV SAPIEN Blog\",\"description\":\"Tools for IT Success\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/dev.sapien.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"The Final Choice - DEV SAPIEN Blog","description":"Let\u2019s wrap up our look at CHOICE.EXE and how to use it in batch files. I\u2019ve shown you some basic examples but CHOICE has a few \u201cadvanced\u201d features you might want to incorporate into your batch file.","canonical_url":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/#blogposting","name":"The Final Choice - DEV SAPIEN Blog","headline":"The Final Choice","author":{"@id":"https:\/\/dev.sapien.com\/blog\/author\/jeffery-hicks\/#author"},"publisher":{"@id":"https:\/\/dev.sapien.com\/blog\/#organization"},"datePublished":"2007-03-30T09:00:00-07:00","dateModified":"2007-03-30T09:00:00-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/#webpage"},"isPartOf":{"@id":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/#webpage"},"articleSection":"Batch\/CMD"},{"@type":"BreadcrumbList","@id":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/dev.sapien.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/dev.sapien.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/dev.sapien.com\/blog\/topics\/batchcmd\/#listItem","name":"Batch\/CMD"}},{"@type":"ListItem","@id":"https:\/\/dev.sapien.com\/blog\/topics\/batchcmd\/#listItem","position":2,"name":"Batch\/CMD","item":"https:\/\/dev.sapien.com\/blog\/topics\/batchcmd\/","nextItem":{"@type":"ListItem","@id":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/#listItem","name":"The Final Choice"},"previousItem":{"@type":"ListItem","@id":"https:\/\/dev.sapien.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/#listItem","position":3,"name":"The Final Choice","previousItem":{"@type":"ListItem","@id":"https:\/\/dev.sapien.com\/blog\/topics\/batchcmd\/#listItem","name":"Batch\/CMD"}}]},{"@type":"Organization","@id":"https:\/\/dev.sapien.com\/blog\/#organization","name":"DEV SAPIEN Blog","description":"Tools for IT Success","url":"https:\/\/dev.sapien.com\/blog\/"},{"@type":"Person","@id":"https:\/\/dev.sapien.com\/blog\/author\/jeffery-hicks\/#author","url":"https:\/\/dev.sapien.com\/blog\/author\/jeffery-hicks\/","name":"Jeffery Hicks"},{"@type":"WebPage","@id":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/#webpage","url":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/","name":"The Final Choice - DEV SAPIEN Blog","description":"Let\u2019s wrap up our look at CHOICE.EXE and how to use it in batch files. I\u2019ve shown you some basic examples but CHOICE has a few \u201cadvanced\u201d features you might want to incorporate into your batch file.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/dev.sapien.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/#breadcrumblist"},"author":{"@id":"https:\/\/dev.sapien.com\/blog\/author\/jeffery-hicks\/#author"},"creator":{"@id":"https:\/\/dev.sapien.com\/blog\/author\/jeffery-hicks\/#author"},"datePublished":"2007-03-30T09:00:00-07:00","dateModified":"2007-03-30T09:00:00-07:00"},{"@type":"WebSite","@id":"https:\/\/dev.sapien.com\/blog\/#website","url":"https:\/\/dev.sapien.com\/blog\/","name":"DEV SAPIEN Blog","description":"Tools for IT Success","inLanguage":"en-US","publisher":{"@id":"https:\/\/dev.sapien.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"DEV SAPIEN Blog - Tools for IT Success","og:type":"article","og:title":"The Final Choice - DEV SAPIEN Blog","og:description":"Let\u2019s wrap up our look at CHOICE.EXE and how to use it in batch files. I\u2019ve shown you some basic examples but CHOICE has a few \u201cadvanced\u201d features you might want to incorporate into your batch file.","og:url":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/","article:published_time":"2007-03-30T17:00:00+00:00","article:modified_time":"2007-03-30T17:00:00+00:00","twitter:card":"summary_large_image","twitter:title":"The Final Choice - DEV SAPIEN Blog","twitter:description":"Let\u2019s wrap up our look at CHOICE.EXE and how to use it in batch files. I\u2019ve shown you some basic examples but CHOICE has a few \u201cadvanced\u201d features you might want to incorporate into your batch file."},"aioseo_meta_data":{"post_id":"102","title":null,"description":null,"keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-08-28 14:18:34","updated":"2026-08-28 14:18:34"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/dev.sapien.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/dev.sapien.com\/blog\/topics\/batchcmd\/\" title=\"Batch\/CMD\">Batch\/CMD<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tThe Final Choice\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/dev.sapien.com\/blog"},{"label":"Batch\/CMD","link":"https:\/\/dev.sapien.com\/blog\/topics\/batchcmd\/"},{"label":"The Final Choice","link":"https:\/\/dev.sapien.com\/blog\/2007\/03\/30\/the-final-choice\/"}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":0,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}