Thursday, June 08, 2006

Dumping files in Desktop

Most of us have the habit of dumping files in the Desktop.If you also fall in this Lazy category :) here are the few DOS commands which can be clubbed together to create a batch file. A single click on this batch file will group all the files and folders with the timestamp. So before saying "bye-bye" in the Friday evening just a single click will take a backup.

1) To create a folder with the current date and time stamp.
Since a folder can't have \, : etc., we are repalcing them by "-"

md c:\"\%date:\=-% %time::=-%"

2)To copy the files and the folders in the Desktop to c:
copy *.* c:\"\%date:\=-% %time::=-%"
b) To copy a folder

xcopy /e *.* c:\"\%date:\=-% %time::=-%"

That's it..

A folder will be created similar to this:
Thu 06-08-2006 16-20-37.30

Deleting of files can be implemented after this to make the desktop a clean-Desktop :)

3 comments:

Deepak Vasudevan said...

Good desktop utility. However, I do have a bit of feature requests or suggestions:

(1) Try bringing in 'MOVE' along with 'COPY', so that two copies of the files are not retained.

(2) Have the inputs, destination path names etc. configurable or as demanded by the user.

Varalakshmi said...

Thanks Deepak for your suggestion..!!
Even I tried to do that by Googling :) Similar to the Move command for moving the files i didn't find any command to move a directory.Do lemme know if there is any way..

Deepak Vasudevan said...

move is there but for per file. The best bet may be to iterate then through the folder structure.