Copy file to different dir
HELP:
I am writing this program and am stuck.
What i am trying to do is prompt user for pathname: d:\data\data.lst and also folder he wants to transfer the file too : s:\data\. Also i want to change filename from data.lst to YYMMDD_HHMM.lst (e.g. 981027_1089.lst)
anybody know any good code or how to do this ??
Farhan
Re: Copy file to different dir
Hi,
Dim input_file as string
Dim output_dir as string
Dim output_file as string
input_file = "d:\data\data.lst"
output_dir = "s:\data\"
output_file = "981029_2156.lst"
filecopy inputfile, output_dir & output_file
that's all
Cya
__Neph__
Re: Copy file to different dir
>>output_file = "981029_2156.lst" <<
but i want the file name to be changed everyday
farhan
Re: Copy file to different dir
re,
you can use the date() function, here's an example
Dim mystr As String
mystr = "Toto"
mystr = Date() & "_" & mystr
on my system the result should be : (it depends of your date format - see regional settings in your Control Panel)
mystr => "30/10/98_Toto"
cya