Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Run a dos batch file as soon as I exit/save the spreadsheet


I have a program that will shell to a batch file and this thread was
helpful.

The program may be installed with different paths on different machines
so I am working on creating the batch file within VB to get the active
path.

I'm finding that if I set up the batch file to work with a drive other
than C that if I copy the program to the c drive it no longer works and
vice versa.

The problem comes from if the program is on the c drive the command
prompt is at ...My Documents. This is the homepath or homedrive
setting. I can't change to another directory on the c: drive when this
is the case or invoke the invoke the program I want to run with a fully
qualified path.

For instance if my appliction is on the c: drive then a batch file
consisting of

cd c:\
pathtofiletorun
filetorun

works,

However,

If I copy the folder that all these files are in to another drive say e:
and try it it doesn't work as the prommpt stays at ...My Documents

In that case I can I can set up the batch file as:

e:
filetorun

In this case after specifying e: the prompt is at the active directory.

The program files are only copied from one place to the other. Would
actually installing them and writing their location to the registry
affect this?

Thanks for any help

Is there some way for it to work for both situations?


*** Sent via Developersdex http://www.developersdex.com ***
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 do I set up a file to automatically save on exit? Brian Excel Discussion (Misc queries) 1 May 15th 10 04:34 PM
excel save file upon exit Sarah Excel Discussion (Misc queries) 2 February 9th 07 06:42 PM
save prompt for user exit, but no save prompt for batch import? lpj Excel Discussion (Misc queries) 1 February 25th 06 02:08 AM
How can I batch open a txt file in excel 2003 and save back as a . P Silzle Excel Discussion (Misc queries) 3 February 9th 05 11:44 PM
Batch Open and Save James[_27_] Excel Programming 1 September 1st 04 05:01 PM


All times are GMT +1. The time now is 11:55 PM.

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

About Us

"It's about Microsoft Excel"