big_grasshopper
asked on
Requesting help with batch file
Ok I what to create a folder with the current date for the name, as well as copy a file into the newly created folder. This is what I have came up with so far, I am able to create the folder with the date, but I am having a problem with coping the file to the newly created folder. The new folder name is going to change every day, and that is the problem that I am having.
========================== ===
@echo off
cls
echo.|time >holdstr
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do md c:\mis\%%a.%%b.%%c
For /f "tokens=1,2* delims= " %%a IN (holdstr) do echo %%b >holdstr
For /f "tokens=1,2* delims=." %%a IN (holdstr) do echo %%a >holdstr
For /f "tokens=1,2,3 delims=:" %%a IN (holdstr) do echo %%a.%%b.%%c >holdstr
For /f "tokens=1,2* delims= " %%a IN (holdstr) do set DirTemp=%%a%%b
del holdstr
copy "c:\winnt\apps\mis" "c:\mis\%%a.%%b.%%c\"
========================== ===
Thank you
==========================
@echo off
cls
echo.|time >holdstr
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do md c:\mis\%%a.%%b.%%c
For /f "tokens=1,2* delims= " %%a IN (holdstr) do echo %%b >holdstr
For /f "tokens=1,2* delims=." %%a IN (holdstr) do echo %%a >holdstr
For /f "tokens=1,2,3 delims=:" %%a IN (holdstr) do echo %%a.%%b.%%c >holdstr
For /f "tokens=1,2* delims= " %%a IN (holdstr) do set DirTemp=%%a%%b
del holdstr
copy "c:\winnt\apps\mis" "c:\mis\%%a.%%b.%%c\"
==========================
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER