Click to See Complete Forum and Search --> : Copy file to different dir


Farhan
October 29th, 1998, 01:54 PM
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

__Neph__
October 29th, 1998, 03:09 PM
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__

Farhan Shah
October 30th, 1998, 09:37 AM
>>output_file = "981029_2156.lst" <<


but i want the file name to be changed everyday


farhan

__Neph__
October 30th, 1998, 02:00 PM
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