?
Solved

Sending variables using shell from one .exe to another .exe . Easy for most people

Posted on 2003-03-24
6
Medium Priority
?
116 Views
Last Modified: 2012-05-04
Hello to all

I got the following code:

Dim MyVars as string
MyVars="Yes"
Shell "c:\winnt\ScrSaver.exe MyVars"

Now i am looking how to send the same variable (MyVars) where MyVars="NO" and WITHOUT the ScrSaver.exe been executed again!! Source Code would be usefull if you can.
Anyone any ideas????

Carlos Bueno
carlosbueno2000@yahoo.com

0
Comment
Question by:cbueno
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 320 total points
ID: 8196656
change like this:

Dim MyVars as string
MyVars="Yes"
Shell "c:\winnt\ScrSaver.exe " &  MyVars

  as for sending a NEW value to the SAME program, that can't be done, as the program has already run, using the initial value passed to it, and it cannot make use of a NEW input value, without being executed AGAIN.

AW


0
 
LVL 4

Expert Comment

by:P1
ID: 8197529
Lookup some code on how to use a mailslot, to dynamically transfer information back and forth between a client and a server type of software.

Regards,  P1
0
 

Author Comment

by:cbueno
ID: 8203109
Hi AW

Why do you suggest me to do it this:
Shell "c:\winnt\ScrSaver.exe " &  MyVars

rather than this:
Shell "c:\winnt\ScrSaver.exe MyVars"

Whats the difference???

Carlos Bueno
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 28

Expert Comment

by:vinnyd79
ID: 8203156
This will pass the value of MyVars to the exe:

Shell "c:\winnt\ScrSaver.exe " &  MyVars


where this will pass the Text "MyVars" to the exe instead of the value:

Shell "c:\winnt\ScrSaver.exe MyVars"


0
 
LVL 4

Expert Comment

by:P1
ID: 8203177
The difference is between direct assignment and in-direct referencing.

1.  Shell "c:\winnt\ScrSaver.exe MyVars" is direct assignment.  The command processor sees "c:\winnt\ScrSaver.exe MyVars" directly from Shell.

2.  Shell "c:\winnt\ScrSaver.exe " &  MyVars is in-direct referencing.  When MyVars = "Yes", the command processor sees "c:\winnt\ScrSaver.exe Yes" as referenced from Shell.

Regards,  P1
0
 

Expert Comment

by:archekrypt
ID: 8216347
Shell "c:\winnt\ScrSaver.exe MyVars"

NO!!!!!

try...

shell "path and filename and extention sa string", & myvars
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question