running a bat file

R

ray

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.
 
R

Rick B

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.
 
R

ray

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.
 
D

Douglas J. Steele

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top