Results 1 to 7 of 7

Thread: Very Very Very Urgent...File Movements

  1. #1

    Thread Starter
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    Hi,

    I need to move a file from one location to another location, through vb. If the file already exists in the target location, I should not get the windows message saying "Overwrite - Yes or no".

    Hope i could make it clear. Is it possible to suppress this message and overwrite the file without asking?

    Please help me with some codes.

    Venkat.

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    use FileCopy

    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company

  3. #3
    Lively Member
    Join Date
    Apr 1999
    Location
    India
    Posts
    73

    Post

    Hi Venkat
    U can creat filesystemobject using vbscripting object. by using this u can move file from one place to other plaec easily....yes it will gv u error when replacing files but it has functions whihc u can use to check for the Presence of file at the destination.
    revert if u need any more help
    Thanx Manish

  4. #4

    Thread Starter
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    Hi Thanx to both of you..Can manish or mark provide me wiht some codes??
    Thanx anyway

    Venkat.

    :-)

  5. #5
    Junior Member
    Join Date
    Nov 1999
    Location
    Houston, TX - USA
    Posts
    21

    Post

    I am not sure with VB6, but with VBA you can override the alert message by writing application.display.alert =false.

    However, as the default is = true, you need to reset it programatically right after the file replace, otherwise you will not see any other alerts.

    VBA does not reset that property automatically.




    ------------------
    Paul Stermann
    DSI-Houston

  6. #6
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112

    Post

    This is from the VB Help Files.

    Code:
    Dim SourceFile, DestinationFile
    SourceFile = "SRCFILE"	' Define source file name.
    DestinationFile = "DESTFILE"	' Define target file name.
    FileCopy SourceFile, DestinationFile	' Copy source to target.

  7. #7

    Thread Starter
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    Hi Thanks Guys, It worked well..

    Regards,

    Venkat.

    :-)

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