On Fri, 14 May 2004 10:28:59 -0700, "Pal" <(E-Mail Removed)>
wrote:
>Hello, I need a batch file to do the following: Can some
>one please help.
>
>1. Check the contents of C:\INPUT\
>2. Check the present month and create a sub folder
>C:\INPUT\<MMMYY>\ if it doesn't exist.
>3.Check the system date and create a sub folder
>C:\INPUT\<MMMYY>\<DDMMM>.
>4. Move C:\INPUT\*.* to C:\INPUT\<MMMYY>\<DDMMM>\*.*
Oops. Here is a revised post:
Place UnivDate.bat from tip 4835 in the 'Tips & Tricks' at
http://www.jsiinc.com
into a folder that is in your PATH, and mmm.bat from tip 6837
@echo off
setlocal
call univdate
set /a yy=10000%yy%10000
if %yy% GTR 99 set yy=%yy:~2,2%
set /a mm=100%mm%%%100
set /a dd=100%dd%%%100
if %dd% LSS 10 set dd=0%dd%
if %mm% LSS 10 set mm=0%mm%
call mmm month
if not exist c:\input\%month%%yy% md c:\input\%month%%yy%
if not exist c:\input\%month%%yy%\%dd%%month% md
c:\input\%month%%yy%\%dd%%month%
REM the above 2 lines are 1 line
move c:\input\*.* c:\input\%month%%yy%\%dd%%month%
Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com