{"id":875,"date":"2020-05-06T17:20:26","date_gmt":"2020-05-06T21:20:26","guid":{"rendered":"http:\/\/main.jmah.net\/?p=875"},"modified":"2020-05-06T17:20:27","modified_gmt":"2020-05-06T21:20:27","slug":"batch-renaming-of-files-using-powershell","status":"publish","type":"post","link":"https:\/\/main.jmah.net\/?p=875","title":{"rendered":"Batch Renaming of Files using PowerShell"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"alignleft size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/main.jmah.net\/wp-content\/uploads\/2020\/05\/powershell-1.jpg\" alt=\"\" class=\"wp-image-878\" width=\"300\" height=\"300\" srcset=\"https:\/\/main.jmah.net\/wp-content\/uploads\/2020\/05\/powershell-1.jpg 640w, https:\/\/main.jmah.net\/wp-content\/uploads\/2020\/05\/powershell-1-300x300.jpg 300w, https:\/\/main.jmah.net\/wp-content\/uploads\/2020\/05\/powershell-1-150x150.jpg 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<p>Windows PowerShell is a very powerful tool for many tasks. The following are two examples using it for batch renaming of files in a folder. <\/p>\n\n\n\n<p>1) Removing the first character from the existing filename, and <\/p>\n\n\n\n<p>2) Replacing a special character with another character in the filename. Adjust the parameter value for your specific requirements.<\/p>\n\n\n\n<p><strong>get-childitem *.txt | rename-item -newname { string.substring(1) }<\/strong><\/p>\n\n\n\n<p><strong>Dir | Rename-Item \u2013NewName { $_.name \u2013replace &#8220;+&#8221;,&#8221; &#8221; }<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows PowerShell is a very powerful tool for many tasks. The following are two examples using it for batch renaming of files in a folder. 1) Removing the first character from the existing filename, and 2) Replacing a special character &hellip; <a href=\"https:\/\/main.jmah.net\/?p=875\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-875","post","type-post","status-publish","format-standard","hentry","category-research-information-technology"],"_links":{"self":[{"href":"https:\/\/main.jmah.net\/index.php?rest_route=\/wp\/v2\/posts\/875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/main.jmah.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/main.jmah.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/main.jmah.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/main.jmah.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=875"}],"version-history":[{"count":8,"href":"https:\/\/main.jmah.net\/index.php?rest_route=\/wp\/v2\/posts\/875\/revisions"}],"predecessor-version":[{"id":885,"href":"https:\/\/main.jmah.net\/index.php?rest_route=\/wp\/v2\/posts\/875\/revisions\/885"}],"wp:attachment":[{"href":"https:\/\/main.jmah.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/main.jmah.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/main.jmah.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}