Link to home
Start Free TrialLog in
Avatar of cbueno
cbueno

asked on

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

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

ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of cbueno
cbueno

ASKER

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
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"


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
Shell "c:\winnt\ScrSaver.exe MyVars"

NO!!!!!

try...

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