473,383 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

passing a .vbs file in the command line

In the command line to my executable I want to pass in a script file and then run that file at a specific point in my program. How do I call that file from within the program?
Apr 6 '07 #1
7 1704
SammyB
807 Expert 512MB
In the command line to my executable I want to pass in a script file and then run that file at a specific point in my program. How do I call that file from within the program?
Are you using VB6? VB.Net? VBA? The answer is different for each.
Do you need help getting the command line argument, or executing a file, or both?
Apr 6 '07 #2
Sorry, it is a .bas file that I want to process. I am using Visual Basic 2005 Express.
Apr 6 '07 #3
I just need help getting it to process (load and run), I can get the parameter via

System.Environment.GetCommandLineArgs()

I would like to load it into the program running to take advantage of an active OLE application object and document.
Apr 6 '07 #4
I am fine converting the file to .vb so if there is a way to do it with that too please tell...
Apr 6 '07 #5
SammyB
807 Expert 512MB
I just need help getting it to process (load and run), I can get the parameter via

System.Environment.GetCommandLineArgs()

I would like to load it into the program running to take advantage of an active OLE application object and document.
So, you are running VB6? Sounds like you want to use GetObject to get the application, but we would need more information to answer how to pass the file to the app. What is the "OLE application object"? What do you mean by "document"? What are you passing to the app? etc.
Apr 6 '07 #6
Turns out I can execute the macro using a method available from the application object. Thanks for the quick reply.
Apr 6 '07 #7
SammyB
807 Expert 512MB
Turns out I can execute the macro using a method available from the application object. Thanks for the quick reply.
You can also create a macro from scratch in your VB code, put it in your app, and execute it.
Apr 6 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Chris | last post by:
I'm trying to come up with a not-so-ugly manner of passing many command-line options between modules. I have a Steering.py file, which contains my main() and handles the getopts getting of...
17
by: Freeserve | last post by:
Hi, I am trying to pass a value from an ASP script to a VB application running on the server. The only way I have got this to work is by using a file, which is too slow. I tried using DDE but...
3
by: AndyDunning | last post by:
Hello, I'm interested in establishing the best way to pass information between a vb script and a .net application. We have a VbScript that runs on a users pc every time a phone call is routed...
10
by: tram | last post by:
How do we pass on the step1 output file to step2 of the same job? I would like to know the current job's output file programmetically, instead of hard coding it. Any idaes would be appreciated. ...
5
by: jlea | last post by:
I'm trying to pass a filename, obtained with using the fileName property from the OpenFileDialog, as a application parameter in Process.StartInfo.Arguments and run a MFC/C++ application using the...
8
by: Robert | last post by:
I am creating a small help browser. It is pretty much finished except I cannot find how to pass a file to it (i.e. browser.exe index.html, or any html file, and the html file opens in the browser)...
0
by: ohmp05 | last post by:
Hi all, I am new to deployment of application. If any one please help me on it , that will be great. During the installation of project, Installer will execute an utility( It will display...
6
by: =?Utf-8?B?Rm9ycmVzdCBIZWxsZXI=?= | last post by:
The only code that is helpful is this: fp = New IO.StreamReader(filename, New System.Text.UnicodeEncoding(True, False), False) If I pass a command line argument to my program that is not from...
2
by: william.w.oneill | last post by:
I have an application that takes a few command line parameters. As recommended by others in this group, I'm using a named mutex to ensure that only one instance of the application is running. My...
4
by: cjt22 | last post by:
Hi there. I just wondered whether anyone could recommend the correct way I should be passing command line parameters into my program. I am currently using the following code: def main(argv =...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.