![]() |
|
|
|||||||
| Petri.co.il is happy to award auglan the title of Most Valuable Member !!! |
| Register | Calendar |
Search |
Today's Posts |
Mark Forums Read |
| Notices |
|
|
BAT file loops, file moving and renamingthis thread has 2 replies and has been viewed 553 times
|
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||||||
|
||||||||
|
I need help making a bat file that moves files from subdirectories to the main directory, and renaming the files to include day stamps (yyyy.mm.dd).
I apologize for the question. At one point in time I was actually a pretty decent C++ and Java coder. 12 years away from the compiler gets you rusty. Let's start off with this disclaimer. My client is an idiot and really doesn't understand drag and drop. I have a situation where files are coming into a directory from three different sources. Sometimes my client will drag only the file into the directory, other times the folder containing the file will be dragged and dropped. I want this scenario from my client: Folder \ files I get this usually: Folder \ files and folder(s) \ files As I said above, I need to get everything back to the Folder \ files scenario. Also, I need to append a day stamp (yyyy.mm.dd) on the beginning of the file names. It would be nice, but not essential, that I can check for the length of the file name and only append the stamp if the name is 8 chars or shorter (excluding the extension). I already have the structures in place to move and back up the file at the end of every day. I can do a bunch of this stuff in Java but I am completely clueless with non trivial bat files. Thank you guys in advance. Jared |
|
#2
|
||||||||||
|
||||||||||
|
You don't say which OS you are using, but IMHO investigate powershell -- lots of potential to do this:
http://www.google.co.uk/search?q=pow...HIWG-wbY98TQAw
__________________
Tom Jones MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+ PhD, MSc, FIAP, MIITT IT Trainer / Consultant Ossian Ltd Scotland ** Remember to give credit where credit is due and leave reputation points where appropriate ** |
|
#3
|
||||||||
|
||||||||
|
Thanks for pointing that out. Win Server 2003.
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Moving Page File | thenoo | Windows 2000 Pro, XP Pro | 5 | 13th July 2010 02:24 |
| Batch file to edit a txt file that is part of a compiled exe file using for /f | Sargeo80 | DOS Command Shell | 3 | 28th June 2010 15:07 |
| batch help for renaming text in file | wbsimsjr | DOS Command Shell | 3 | 6th June 2010 16:35 |
| Moving priv1.edb file never completes | mvolkers | Exchange 2000 / 2003 | 5 | 13th July 2009 06:27 |
| Moving Data & File Permissions | UKG | General Scripting | 15 | 7th September 2006 16:06 |