{"id":9387,"date":"2021-12-01T11:49:18","date_gmt":"2021-12-01T11:49:18","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=9387"},"modified":"2021-12-01T11:49:51","modified_gmt":"2021-12-01T11:49:51","slug":"solved-batch-file-to-set-registry-values-as-variables","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/batch-file-to-set-registry-values-as-variables\/29774.html","title":{"rendered":"Solved Batch File To Set Registry Values As Variables"},"content":{"rendered":"<p>I am trying to find a way to store a registry key value in a variable to use it later.<\/p>\n<p>For example: some data in a value is a full path to an executable file that I want to delete from my hard disk. So if I can store it as a variable I can use it on a DEL command and delete it.<\/p>\n<p>Seems REG QUERY can do it in some way, but it returns too much trash. Here&#8217;s another example.<\/p>\n<p>If I use<\/p>\n<p>REG QUERY &#8220;HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run&#8221; \/v AlcoholAutomount<\/p>\n<p>It returns to me<\/p>\n<p>HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run<br \/>\nAlcoholAutomount REG_SZ &#8220;C:\\Program Files (x86)\\Alcohol Soft\\Alcohol 120\\AxAutoMntSrv.exe&#8221;<\/p>\n<p>I just want the part &#8220;C:\\Program Files (x86)\\Alcohol Soft\\Alcohol 120\\AxAutoMntSrv.exe&#8221;, which is the data of the AlcoholAutomount value.<\/p>\n<p>Any clues?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":1},"question-category":[55],"question_tags":[],"class_list":["post-9387","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/9387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=9387"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=9387"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=9387"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=9387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}