PDA

Click to See Complete Forum and Search --> : Very Very Very Urgent...File Movements


venkatraman_r
Nov 7th, 1999, 07:05 PM
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.

Mark Sreeves
Nov 7th, 1999, 07:08 PM
use FileCopy

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

Mark.Sreeves@Softlab.co.uk
A BMW Group Company

Manish
Nov 7th, 1999, 07:10 PM
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

venkatraman_r
Nov 7th, 1999, 07:44 PM
Hi Thanx to both of you..Can manish or mark provide me wiht some codes??
Thanx anyway

Venkat.

:-)

prestodsi
Nov 7th, 1999, 08:35 PM
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

Ishamel
Nov 7th, 1999, 08:36 PM
This is from the VB Help Files.


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

venkatraman_r
Nov 7th, 1999, 10:16 PM
Hi Thanks Guys, It worked well..

Regards,

Venkat.

:-)