VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Very simple way to check/copy a file

by Jessy Butzke (11 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 6th August 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Very simple way to check/copy a file

Rate Very simple way to check/copy a file



Dim fso
Dim strFile As String
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists("c:\windows\Calc.exe") Then
    FileCopy "c:\windows\Calc.exe", "c:\windows\desktop\Calc.exe"
    MsgBox "The program Calc.exe has been copied to your desktop. You can edit the file paths in the code to run how you want it to.", vbInformation, "Notice"
Else
    MsgBox "The file you are trying to copy does not exist.", vbCritical, "Error"
End If
End Sub

Download this snippet    Add to My Saved Code

Very simple way to check/copy a file Comments

No comments have been posted about Very simple way to check/copy a file. Why not be the first to post a comment about Very simple way to check/copy a file.

Post your comment

Subject:
Message:
0/1000 characters