{"id":12193,"date":"2021-12-09T00:31:45","date_gmt":"2021-12-09T00:31:45","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=12193"},"modified":"2021-12-09T00:32:03","modified_gmt":"2021-12-09T00:32:03","slug":"batch-script-to-list-folder-permissions","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/batch-script-to-list-folder-permissions\/20938.html","title":{"rendered":"Batch Script To List Folder Permissions"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I would like to write a batch script to perform the following tasks,<\/p>\n<p>1) The script should ask the user to input the drive information (C:\\, D:\\, etc)<br \/>\n2) Once the user inputs the drive information, it should print all the folders (not sub-folders, only the folders) in that drive to a file.<br \/>\n3) Now the script should find the folder permissions for the list of folders printed in the file.<br \/>\n4) It should print the output to a file.<\/p>\n<p>I&#8217;ve the script to do the steps 3 &amp; 4. But currently it will work only on the folder you specify. I want to have this done for all the folders in a drive.<\/p>\n<p>@echo off<br \/>\nset target=C:\\test<br \/>\ncacls &#8220;%target%&#8221; &gt; c:\\list.txt<br \/>\nfor \/F &#8220;tokens=*&#8221; %%* in (&#8216;dir \/b \/ad &#8220;%Target%&#8221;&#8216;) do cacls &#8220;%target%%%*&#8221;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":7},"question-category":[55],"question_tags":[],"class_list":["post-12193","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\/12193","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=12193"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=12193"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=12193"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=12193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}