running a bat file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have this simple bat file that does the following

del file1.txt
rename file.txt file.txt

This text file is on a server and I am trying to set it up so that I can do
an import. I delete and rename the file because the file is rebuilded every
20 minutes. But I can not seem to get access to run the bat file.
 
What is your question?

What have you done to get Access to run the file?

What error message are you getting?

Tell us what the problem is.
 
I thought I could run it in a shell

Dim x
x = Shell("\\DCI-1600\SCAN\RMN.BAT")

also tried

Dim x
x = Shell("D:\Scan\rmn.bat")

nothing worked either way.
 
Why not just use VBA commands, rather than bothering with a .BAT file?

To delete a file, use the Kill statement:

Kill pathname

To rename a file, use the Name statement:

Name oldpathname As newpathname
 
Back
Top