PDA

View Full Version : I.T help required















Kev Y.
24th April 2006, 11:14 AM
HEEEELLLPPP.

I have been asked to create a small application which will:

a) create a directory which is the current date,
b) move files from another directory INTO the new directory
c) have the task repeated every night at 11:59

My questions are, which program is more suitable for this task?, would a batch file do it for me?

Can some one shed some light on this for me, it has been way too long since I last looked at doing any programming... have been looking up reference books (C++) but too no avail :(

Gra
24th April 2006, 11:21 AM
Batch file, with a Kron job to set it off (Sheduled Task, Eg Msoft scheduler). We do it here all the time, just cant remember the code....

Krunchy
24th April 2006, 02:18 PM
HEEEELLLPPP.

I have been asked to create a small application which will:

a) create a directory which is the current date,
b) move files from another directory INTO the new directory
c) have the task repeated every night at 11:59

My questions are, which program is more suitable for this task?, would a batch file do it for me?

Can some one shed some light on this for me, it has been way too long since I last looked at doing any programming... have been looking up reference books (C++) but too no avail :(

Hi Brudda,

This below should work (I quickly tested it under Windows XP) - all you need to do is save the code below as a batch file and use the windows scheduler to call it at 11:59.


@ECHO OFF
FOR /f "tokens=2-4 delims=:/- " %%F IN ("%DATE%") DO SET D1=%%F&SET D2=%%G&SET D3=%%H
:: The Date tokens in D1, D2, and D3 will be in your local date order
MD %D1%%D2%%D3%
move c:\path\to\files %D1%%D2%%D3%

Hope it helps.

Krunchy