Link to home
Start Free TrialLog in
Avatar of akeena_g
akeena_g

asked on

Calling an .exe file in VB

Hello,

We have a Java program called Test that has a textbox on it.  The user would enter a path and then press the Enter key.  The path will then be used to process other commands in the application.  

Now, we converted our Java application into an .exe file.  We then want to call this file in a VB application by using Shell.  Our syntax goes like this:

a = Shell("Test.exe")
AppActivate a
SendKeys "C:\TestFile.pdf"
SendKeys "{Enter}"

The textbox (in the Java app) receives the focus when the program is loaded.  However, the program doesn't work.  What do I need to make it work?

Thanks in advance!

ASKER CERTIFIED SOLUTION
Avatar of plq
plq
Flag of United Kingdom of Great Britain and Northern Ireland 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
Avatar of inthedark
I would go with plq's suggestion with one small addition, if you had a long file names it is better to use double quotes:

a = Shell("Test.exe ""C:\TestFile.pdf""")
Avatar of akeena_g
akeena_g

ASKER

How exactly can I make my exe prog accept a command line argument?
try following


  ReturnValue = Shell("NOTEPAD.EXE", 1)
  AppActivate ReturnValue
 
  SendKeys "Hello"
  SendKeys "{Enter}"


hope it helps,
khaleel

SOLUTION
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