{"id":691,"date":"2022-11-06T00:46:50","date_gmt":"2022-11-06T00:46:50","guid":{"rendered":"https:\/\/lavenhamit.uk\/wrdprss\/?p=691"},"modified":"2022-12-10T16:31:21","modified_gmt":"2022-12-10T16:31:21","slug":"windows-batch-file-to-create-an-empty-folder-structure-in-the-same-folder","status":"publish","type":"post","link":"https:\/\/lavenhamit.uk\/wrdprss\/?p=691","title":{"rendered":"Windows Batch File &#8211; to create an empty folder structure in the same folder"},"content":{"rendered":"\n<p>Paste the following code into a .bat text file to create a runnable script that makes a new empty folder structure within the same directory by double-clicking the file or running from the command line. You can change the CALL lines to reflect the folder names you require.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@ECHO OFF\r\nTITLE Make Folders\r\nREM use path of script %~dp0 as working directory \r\nREM this ensures that working directory is set expicitly\r\nREM if run from CMD prompt the script path might be otherwise ignored\r\npushd %~dp0\r\nECHO Making Empty Folder Structure \r\nCALL :MakeFolder My-Config\r\nREM create a folder with a space in the name use quotes \"My Config\"\r\nCALL :MakeFolder My-Desktop\\Sub-folder\r\nREM create a sub folder\r\nCALL :MakeFolder My-Documents\r\nCALL :MakeFolder My-Downloads\r\nCALL :MakeFolder My-Music\r\nCALL :MakeFolder My-Pictures\r\nCALL :MakeFolder My-Videos\r\npopd\r\nTIMEOUT 5\r\nEXIT \/B %ERRORLEVEL%\r\nREM\r\nREM create folder function\r\n:MakeFolder \r\nSET fldr=%~1\r\nif not exist %fldr% MD %fldr%\r\nEXIT \/B 0\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Paste the following code into a .bat text file to create a runnable script that makes a new empty folder [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[68,69],"class_list":["post-691","post","type-post","status-publish","format-standard","hentry","category-windows-batch-files","tag-batch-file","tag-create-folders"],"_links":{"self":[{"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=\/wp\/v2\/posts\/691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=691"}],"version-history":[{"count":2,"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=\/wp\/v2\/posts\/691\/revisions"}],"predecessor-version":[{"id":727,"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=\/wp\/v2\/posts\/691\/revisions\/727"}],"wp:attachment":[{"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lavenhamit.uk\/wrdprss\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}