1.

Solve : Deleting Directory Dynamically?

Answer»
          Hello All,

          I need help on deleting directories;
          I have a particular ETL session, which will load data for each country from a particular folder called "TempData"

          This folder, CONTAINS
sub-folders with names like,

ABCxxxxx_CNTRY_DDMMYYYY, where
  • xxxxx re-presents some unique numbers,
  • ddmmyyy re-presents day, month year
  • eg. ABC12345_JP_26102009
  • The folder names can't be hard-coded as the numbers, country name, and DATES keep changing
Once the data is loaded, I need to delete the contents (of a particular country) from this "TempData" folder.

I've tried using the following,

RMDIR /s /q X:\TempData\*_JP_*
DEL X:\TempData\ABC?????_JP_*

BUT both don't work.

any help would be highly appreciated.
Thanks.

Try using ROBOCOPY

http://en.wikipedia.org/wiki/Robocopy

It can HANDLE sub folders



Discussion

No Comment Found