CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 1998
    Posts
    2

    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

  2. #2
    Join Date
    Apr 1999
    Posts
    5

    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__

  3. #3
    Join Date
    Jan 1999
    Posts
    3

    Re: Copy file to different dir



    >>output_file = "981029_2156.lst" <<


    but i want the file name to be changed everyday


    farhan

  4. #4
    Join Date
    Apr 1999
    Posts
    5

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured