move all .doc files to diff drive same path

July 8, 2011 at 13:04:26
Specs: Windows XP
I'm trying to find and copy all user data files from drive #1 to drive #2, placing the files in drive #2 in same folder as they were found on the drive #1.
For example:
I search the C: Drive for *.doc and *xls files and find three in C:\temp\stuff. I want to automatically create a folder on the D: Drive (D:\temp\stuff) and copy the *.doc and *.xls files there.

Is there any way to do this with a batch or simple vbscript?
Thanks in advance

See More: move all .doc files to diff drive same path

Report •

July 8, 2011 at 22:12:07
you could try, in basic

declare array (100)
declare arraycount as integer
shell("dir *.xls, *.doc /x") > temp_input.txt
open temp_input.txt for binary as #1
get, , #1, asc(in$)

for I = 1 to (max amount here)
if asc(chr$(in$, I, 1)) = 13 then
i += 1
arraycount +=1
array(arraycount) = chr$(in$, I, 1)
end if

and then just manipulalte the shell() later on... I dunno it's been a while since I've done binary handling in basic.

Report •

July 12, 2011 at 06:38:15
Thanks much. I'll give it a try and let you know much you remember!

Report •

Related Solutions

Ask Question