Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 13-09-2007, 05:28 PM   #1 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Question DOS: Create a directory according to the date. How


Can someone help me in creating a bat file.

Intended task
1. On my desktop there are many text files for which I need to make a backup
2. In D drive it should create a folder Back if it does not exist
3. I plan to run this file everyday, so it should create a subdirectory in the Directory back that is for the current day
4. Copy the text files to the subdirectory according to todays date

D:\Backup\Yesterday
D:\Backup\Today
D:\Backup\Tomorrow

Needless to say, yesterday, today and tomorrow would be the respective dates
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 13-09-2007, 06:00 PM   #2 (permalink)
din
Tribal Boy
 
din's Avatar
 
Join Date: Jun 2004
Location: Cochin , Kerala
Posts: 1,724
Default Re: DOS: Create a directory according to the date. How

May be you need this ?

DateDir: A Date-Naming Utility for Windows

This may be useful too

Last edited by din; 13-09-2007 at 06:06 PM.
din is offline  
Old 13-09-2007, 06:10 PM   #3 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: DOS: Create a directory according to the date. How

Din, Thx for the link, however it has issues when a limited permission user tries to run it. Also, we can't run these apps in my office. So, I need to do it manually.

Even, if some1 guides me how to make a directory for today's date, it will help me a lot.
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
Old 13-09-2007, 06:15 PM   #4 (permalink)
din
Tribal Boy
 
din's Avatar
 
Join Date: Jun 2004
Location: Cochin , Kerala
Posts: 1,724
Default Re: DOS: Create a directory according to the date. How

Oh, I am sorry it didn't help

But theres something about the batch files in both links ? May be thats useful ?
din is offline  
Old 13-09-2007, 06:35 PM   #5 (permalink)
The Frozen Nova
 
casanova's Avatar
 
Join Date: Sep 2004
Location: Trespasser in Virtual Land
Posts: 1,641
Default Re: DOS: Create a directory according to the date. How

Thx a ton Din. Second link helped me. I achieved what I wanted to do. Thx again.

Here's the file
Quote:
d:
cd backup_kb
md TEXT_%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%
c:
cd..
cd desktop
copy *.txt d:\backup_kb\TEXT_%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%
pause
It created the dir TEXT_20070913 ie. yyyymmdd format
__________________
I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

www.nerdweed.blogspot.com
casanova is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ny fone directory ?? VirusKiller QnA (read only) 4 23-01-2009 12:02 PM
Automatic Update Directory abhijangda Tutorials 1 30-04-2007 05:32 PM
Directory Traversal in C/C++ rachitar Programming 1 18-09-2005 11:49 PM
Where is the OS directory? jnpandya QnA (read only) 8 26-08-2004 11:21 PM

 
Latest Threads
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 05:19 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2