Running a Batch File Within Access

G

Guest

Hi Al

I hope someone can help me

I have created a batch file that renames a long character name with an unassociated program attached to it to a short name.txt file. As we are an educational environment these files will always be created in this unrecognisable format and we will always need to changed the txt format so that we can import these files into the database. External clients use this database so we need the process to be as simple as possible

At the moment I have a work around where I have created a batch file for every year that we report (each folder like 2002,2003,2004) I have had to sit this batch file in every file and I then call it using the Runapp function in the macro. It works fine however it means that we have to send a number of batch files out to the clients which means there could be issues if they don't put them in the incorrect place. What we need is a process of adding the batch file actually within the db so that it can run from the macro and will change the files in the correct directory's externally

Has anyone out there know how to do this or whether it can be done? is Runapp the correct function I should be using or should I be using visual basic code? I would be greatly appreciated for any advice

Regard

Lizzi
 
S

Steve Schapel

Lizzie,

This is one of those occasions where a VBA procedure would be much
simpler than a macro. In VBA, you can use this statement:
Name "C:\MyFolder\LongName.xxx" As "C:\MyFolder\ShortName.txt"
and there is no equivalent functionality in macros. The advantage
becomes even greater if you need to use variable folder names, for
example...
Name "C:\" & Year(Date) & "\LongName.xxx" As ...
 

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

Similar Threads


Top