Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

possible to execute a .bat using VB script?

Status
Not open for further replies.

dalex17

Technical User
Jul 14, 2002
96
US
Hello,

Is it possible to execute a batch file using VB Script editor?

If so, I would like to know the code.

Dalex


 
in vba you use the shell command

shell("c:\my_batch.bat")
 
thank you for the reply ETID.

What I failed to state in my earlier message was that I am trying to enter this code in Cognos Script Editor. Being the novice that I am, I thought they might function the same; which I do not think they do...

Do you have any additional thoughts based on this new piece of information?
 
I created a macro, using Cognos Script Editor, which automatically creates (save as) an .xls file from an Impromptu report (Impromptu is a report writer software).

I then created a simple batch file which opens the .xls file. So far so good.

The challenge I am having is that every time I run the macro which creates the .xls file, it overwrites any macros I wrote in vba in excel..so when the .xls is opened nothing happens.

My vbs script in excel is suppose to perform some custom actions each time it is opened, however each time the macro overwrites the excel file the script dissapears. It would be great if the macro can overwrite the data of the existing excel file, but not any of the vba code.

I sure hope I made sense

Dalex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top