Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 117
  • Last Modified:

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

0
cbueno
Asked:
cbueno
1 Solution
 
Arthur_WoodCommented:
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
 
P1Commented:
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
 
cbuenoAuthor Commented:
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
Independent Software Vendors: 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!

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

NO!!!!!

try...

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

Featured Post

Independent Software Vendors: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now