473,406 Members | 2,273 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,406 software developers and data experts.

Read variables through EXE

Sorry for the confusing topic, I wasn't sure how to word this exactily.

I have a program that needs to read a variable in from the outside.
Specifically, the program will be run like this:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Exec("myProgram.exe 123456")
end sub

myProgram.exe is a VC++ application
123456 is a variable I want to be able to read into this VC++ application.

Any advice on how to do this would be greatly appreciated. I tried looking
around for an answer but I could not find a decent reference
Nov 17 '05 #1
2 983

"ashton" <as****@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.com...
Sorry for the confusing topic, I wasn't sure how to word this exactily.

I have a program that needs to read a variable in from the outside.
Specifically, the program will be run like this:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Exec("myProgram.exe 123456")
end sub

myProgram.exe is a VC++ application
123456 is a variable I want to be able to read into this VC++ application.

Any advice on how to do this would be greatly appreciated. I tried looking
around for an answer but I could not find a decent reference


Perhaps this short article on an alternate form of the main() header will
help:

"In many example programs, the parameters to main are left off (they are
optional) and so you may have never been exposed to the complete use of
main().

The full syntax for main is:

int main(int argc, char* argv[]);

.....where argc is the "argument count" ("argument" applying to command-line
arguments) and argv is an array of argc elements, each a pointer to a
command line argument (as a string, of course). The first element is
always the program's own name.

For example, if you had a program called FOO.EXE that you had started by
entering...

FOO /a /b "my argument"

.....on the command-line, you could access the command-line arguments in
your code like so...

int main(int argc, char* argv[])
{
int iArgCount = argc; // equal to 4
char* pszProg = argv[0]; // points to something like "FOO.EXE"
char* pszArg1 = argv[1]; // points to "/a"
char* pszArg2 = argv[2]; // points to "/b"
char* pszArg3 = argv[3]; // points to "my argument"

Nov 17 '05 #2
Just what I needed, thanks!
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: maxwell | last post by:
I used to program in matlab An read an image file with : fread(a,,0) which gave me a matrix of 256*256 full of numbers which were the pidxel values from 0 to 256. How do i do the same in c++ ...
4
by: Ronny Mandal | last post by:
Hi. Assume you have a file with the format 1.2 4.2 4.3 2.9 i.e doubledouble
5
by: Oleg Ogurok | last post by:
Hi all, Is there a way to read other people's session variables? I understand it makes sense that session state is on per-user basis, but still... Is there a way to get a collection of all...
5
by: Just Me | last post by:
Using streams how do I write and then read a set of variables? For example, suppose I want to write into a text file: string1,string2,string3 Then read them later. Suppose I want to write...
2
by: dumbo | last post by:
Hello, who gives one more shining solution to me? My application load form "A". The form "A" by means of a push-button load form "B" that in its turn by means of a push-button load form "C". Form...
6
by: Samuel M. Smith | last post by:
I have been playing around with a subclass of dict wrt a recipe for setting dict items using attribute syntax. The dict class has some read only attributes that generate an exception if I try to...
4
by: Pim75 | last post by:
Hello, I have to read a XML file in ASP and save the values in a database. I can get this work, but I cannot read some nested nodes of the xml file. This is a part of the XML file: ...
1
by: Shashank | last post by:
Hi all, I am a new member of this community. I am making a http request to a html file placed on a Apache server. On this page there is an embeded perl statement which requires reading ...
2
by: kowndinya | last post by:
Hello, i want to read values from a binary file in VisualBasic 6.0 Initially i want to read only header of this binary file. I know this structure for this header. It is 100 bytes long and...
6
by: Per Juul Larsen | last post by:
Hi. My Textfile looks like this Variable 1 Variable 2 Variable 3 Variable 4 On opening the application it will read the textfile, and assign each line of variable to at textfield in VB and...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.