*.bat / copy

border20

Registered User.
Local time
Today, 21:44
Joined
Jan 8, 2003
Messages
92
Is there a way to run a bat file from access ? or even better to do a copy operation ?
 
Create a button. Then use this code (on click) :

Private Sub Command9_Click()
Dim RetVal
RetVal = Shell("D:\TEST.BAT", 1)
End Sub
 
Ok I did that but the bat file didn't run normaly,,, the root was Mydocs folder instead of the dir where the file is located...
 
Last edited:
Do you want to copy a single file that will always be in the same location with the same file name?

Or, do you want to copy all files from one folder to another?
 
I only want to copy a simple file that will always be in the same location with the same file name
 
Easy...you want to use the FileCopy Statement. Check the help files for more info on using the FileCopy Statement.

Copy source file to target file...

FileCopy C:\Test\Source.txt, X:\Testing\Destination.txt

HTH
 
ok, but will thew filecopy statemement take a relative path ?? for example could i put:

filecopy /folder/document.doc, /document.doc

?
 

Users who are viewing this thread

Back
Top Bottom