Batch copy command

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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.
 
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
 
Back
Top