Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default executing batch files using VBA


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:?


--
srkumar
------------------------------------------------------------------------
srkumar's Profile: http://www.excelforum.com/member.php...o&userid=20037
View this thread: http://www.excelforum.com/showthread...hreadid=534991

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default executing batch files using VBA

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")
--
HTH...

Jim Thomlinson


"srkumar" wrote:


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:?


--
srkumar
------------------------------------------------------------------------
srkumar's Profile: http://www.excelforum.com/member.php...o&userid=20037
View this thread: http://www.excelforum.com/showthread...hreadid=534991


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I batch convert 97-2003 .xls files to 2007 .xlsx files Dave Nuttall Excel Discussion (Misc queries) 4 August 3rd 09 11:38 PM
Batch Files nickysquawkes[_4_] Excel Programming 6 March 2nd 06 08:13 PM
Batch conversion of XP files to 97 files AG Excel Discussion (Misc queries) 2 October 2nd 05 02:08 PM
Batch Files Mitch[_2_] Excel Programming 4 October 4th 03 04:40 PM
Batch files and VBA daver676 Excel Programming 2 September 17th 03 06:57 PM


All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"