|
Subject:
|
Copying selected files in vb
|
|
Posted By:
|
sunitha_padmanabhan
|
Post Date:
|
10/11/2004 4:45:15 AM
|
Hello everybody,
Iam Sunitha here, I want to create an application in vb which can copy a selected file from a particular path and create it many number of times, i.e., if I select a file sample.doc from C: drive and give 2 in the text box it has to create the sample.doc two times in a specified drive might be D: or E:, any suggestions for the above problem.
Thanks, Sunitha
Sunitha
|
|
Reply By:
|
om_prakash
|
Reply Date:
|
10/13/2004 7:22:36 PM
|
But one file cannot be created more than once with same name in the same location. Along with number of files to create, is there any input text box where the path(s) will be entered?
Om Prakash
|
|
Reply By:
|
belzicool
|
Reply Date:
|
11/15/2004 6:43:16 AM
|
check this link: http://www.freevbcode.com/ShowCode.asp?ID=499&NoBox=True
you can give the source file path and destination file path as arguments using the function in the above link. If a user gives input as say 3 copies of file "count.xls", then use the copy function in loop and add a string to the filename every time it copies.
using the function from the link, for i=1 to 3 shellfilecopy("c:\count.xls","f:\" & "count" & integer2string(i)& ".xls")
integer to string will be a function which will convert an integer to string. hence u will get fiels of the name count1.xls,count2.xls,count3.xls
hope it helps
|