Batch copy command

G

Guest

I am trying to write a batch file which will copy a set of files into
different subdirectories based on the first four characters of the file name,
e.g. I have a set of 200 files with the same type of file name - a six digit
number followed by a numbered extension. If the file name is 123456.1 it
should be copied into the 123400 directory; 567890.1 should be copied into
the 567800 directory. Is there a DOS command that is the equivalent of the
STR command in Visual Basic?

Thanks!
 
G

Guest

I'm sorry, I think I asked the wrong question. I know how to use wildcards in
the copy statement, I was wondering if there is a way to evaluate the first
four characters of the filename and set the subdirectory to those four
characters. In VBA it would look something like: Subdir = Left(FileID,4).
Is there a DOS equivalent to the Left function?

Thanks again.
 
P

Paul Greeff

Good day

You got me! I don't know, but I would like to know the answer myself. If I
find anything out I'll post it here. Good luck!

PG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top