executing batch files using VBA

S

srkumar

Hi,

I would like to accomplish the following and appreciate any advice. I
would like to create a loop using VBA that repeatedly executes a batch
file for different parameters. i tried the shell command: shell
("cmd.exe D:\abc\test.bat") but keep getting the msg.:
"cmd.exe was started with 'D:\abc' as the current directory path. UNC
paths are not supported. Defaulting to windows directory" and each time
the system returns to C:\WINNT>.

is there a way around this that allows me to execute batch files that
are located in drives other than C:?
 
J

Jim Thomlinson

A batch file is an executable file. Why do you have cmd.exe preceding the
batch file. Shouldn't it be just...

shell ("D:\abc\test.bat")
 

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