Copying single files into a folder that changes name every time the batch file is executed
- by Daniel Jochem
Can you please help, I am using this to put the text files made by the batch file into the folder created by the batch file as well. but my problem is that the name is changed of the new folder every time because it is named by the date and time it was created. This is the code:
@echo off
for /F " tokens=1,2,3* delims=/, " %%i IN ('date /T') DO (
set CUR_DAY_OF_WEEK=%%i
set CUR_MONTH=%%j
set CUR_DAY=%%k
set CUR_YEAR=%%l)
for /F " tokens=1,2,3* delims=:, " %%i IN ('time /T') DO (
set CUR_HOUR=%%i
set CUR_MIN=%%j
set AM_PM=%%k)
if not exist E:\Private goto :F
cd E:\Private
md "E:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%"
goto :start
:F
if not exist F:\Private goto :G
cd F:\Private
md "F:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%"
goto :start
:G
cd G:\Private
md "G:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%"
goto :start
:start
start /min A /stext A.txt
start /min B /stext B.txt
start /min C /stext C.txt
start /min D /stext D.txt
(As the directory (E:-G:) changes, how can I check all without an error? And once that is found, then put all these text files into the date folder.