I want to write a batch script to create folders.
I have a notepad with multiple lines in the following location C:\Users\sanjeep.verma\Desktop\Production Files\folder_list.txt
The batch file should create folders with names that is written on each line in the above text file.
In each of the newly created folder the following xlsm file must get pasted: C:\Users\sanjeep.verma\Desktop\DIW.xlsm
Please help with the batch file script as the below batch script is not working as intended.
Note: The below code works file to create the folders from each line of the text file. however, it does not paste the xlsm file into each of the newly created folders.
I have a notepad with multiple lines in the following location C:\Users\sanjeep.verma\Desktop\Production Files\folder_list.txt
The batch file should create folders with names that is written on each line in the above text file.
In each of the newly created folder the following xlsm file must get pasted: C:\Users\sanjeep.verma\Desktop\DIW.xlsm
Please help with the batch file script as the below batch script is not working as intended.
Code:
@echo off
set folder_list=C:\Users\sanjeep.verma\Desktop\Production Files\folder_list.txt
set source_file=C:\Users\sanjeep.verma\Desktop\Debt Income Worksheet.xlsm
set target_folder=C:\Users\sanjeep.verma\Desktop\Production Files\
for /f "delims=" %%i in (%folder_list%) do (
md "%target_folder%\%%i"
copy "%source_file%" "%target_folder%\%%i"
)
Note: The below code works file to create the folders from each line of the text file. however, it does not paste the xlsm file into each of the newly created folders.
Code:
@echo off
for /f "delims=" %%a in (folder_list.txt) do (
mkdir "%%a"
)