|
-
Nov 7th, 1999, 08:05 PM
#1
Thread Starter
Hyperactive Member
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.
-
Nov 7th, 1999, 08:08 PM
#2
Frenzied Member
use FileCopy
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Nov 7th, 1999, 08:10 PM
#3
Lively Member
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
-
Nov 7th, 1999, 08:44 PM
#4
Thread Starter
Hyperactive Member
Hi Thanx to both of you..Can manish or mark provide me wiht some codes??
Thanx anyway
Venkat.
:-)
-
Nov 7th, 1999, 09:35 PM
#5
Junior Member
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
-
Nov 7th, 1999, 09:36 PM
#6
Lively Member
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.
-
Nov 7th, 1999, 11:16 PM
#7
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|