View Full Version : Batch File (.bat) Coding

07-30-2008, 11:36 AM

I have basic knowledge of .bat files and need some advice on how to code something. I need a .bat (or equivalent) to move files into a specific folders based on the files name.

For example.

Original folder (which is the source of retrieval) contains:

Sub-folders are:

So the .bat needs to run on the original folder. It needs to recognise the first word of in the filename and then move the file into the corresponding folder leaving the original file empty. Also the filename needs to remain the same as it was originally.

If anyone can help me with this it would be much appreciated.



07-30-2008, 02:15 PM
Batch files are quite limited in their capabilities, and this sounds like one instance where they won't help. You might rather try searching for 'Windows shell scripting' or, perhaps better, install Windows Power Shell straight from MS and start learning that. Off the top of my head, this sounds like a use for regular expressions and old-school DOS batch files won't be very helpful.

07-30-2008, 03:24 PM
I was only aware of the basic functions of batch files, I was kinda hoping no one would tell me this.
I'll look into the windows shell scripting but if you or anyone else figures another easy way please let me know.
Anything to carry out this type of operation will do.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum