|
Answer» i would like moving bacth script to move the file with DIFFRENT TYPE and different folder name.
example: move /y e:/FW_purge_archive/zipfiles/Ter_20081104\*ter\ E:\FW_purge_archive\zipfiles\2008\2008-11
Ter_20081104 (is winzip files with Ter_YYYYMD)year month and date
i dun wan keep writing again in my coding due to the so many month in one year and date and became hard coding.
any idea for me to define and SOLVE it
Regards Danny
My ENGLISH is poor, I don't know how to describe.
You can first use this CODE to show and check. if the result is right, cut 'echo ' from 'echo move /y "%%i\*ter" "%filepath%\!YYYY!\!YYYY!-!MM!" 2>nul', then run the batch. Code: [Select]@echo off set filepath=e:\FW_purge_archive\zipfiles setlocal enableDelayedExpansion for /d %%i in ("%filepath%\Ter_*") do ( set fp=%%i set YYYY=!fp:~-8,4! set MM=!fp:~-4,2! if not exist "%filepath%\!YYYY!\!YYYY!-!MM!" md "%filepath%\!YYYY!\!YYYY!-!MM!" echo move /y "%%i\*ter" "%filepath%\!YYYY!\!YYYY!-!MM!" 2>nul ) setlocal disableDelayedExpansionunable to use the script.....neeed help
would like moving bacth script to move the file with diffrent type to the different folder by year and month example:
move /y e:/FW_purge_archive/zipfiles/Ter_20081104\*ter\ E:\FW_purge_archive\zipfiles\2008\2008-11
example: File type Ter_20081104.tgz (is winzip files with Ter_YYYYMD.tgz)year month and date Fin_20081204.tgz
i dun wan keep writing again in my coding due to the so many month in one year and date and became hard coding.
Thank
|