Rename directory name using batch file
I need help to rename all directories in a folder with the name structure as "BS2315_20070212_2039.zip" to "BS2315_20070212_2039" (ie i need to remove the ".zip" extension from all the directory names). These directories are created dynamically everyday from zip files which i unzip using the following batch file, hence the names of the directories is not known. I need a batch file which automatically changes the names of all the directories by removing ".zip" extension after unzipping the files using the batch file code shown below:
xcopy c:\data_load c:\data_load_backup
for %%f in (*.zip) do unzip %%f -d c:\unzipped_data\%%f
Also, Is there any way by which we can parse directory names like a string and edit it. Hence use it later to rename the file name?
for %%f in (*.zip) do (
unzip %%f -d c:\unzipped_data\%%f
--- set dirname as %%f
--- Edit dirname here..
--- rename %%f to dirname
Any help will be deeply appreciated..