Sign in to follow this  
Followers 0
magace

Send() is not sending full line of code.

6 posts in this topic

I am creating a simple program to connect to my vpn.  However when sending threw cmd line it seems to send part of the code out of order.

Func Connect()
Run("cmd.exe")
WinActivate("cmd.exe")
sleep(1000)
Send('"C:\Program Files (x86)\HMA! Pro VPN\bin\HMA! Pro VPN.exe" -connect')
EndFunc

This is what it types into the cmd line:  Bold is the text the script sends

C:UserstestdeeeezDesktopConnect>"C:Program Files (x86)HMAonnect
 
I need it to send this:

"C:Program Files (x86)HMA! Pro VPNbinHMA! Pro VPN.exe" -connect

Any ideas why its messing up?

Thanks!

Share this post


Link to post
Share on other sites



try:

Send('"C:\Program Files (x86)\HMA! Pro VPN\bin\HMA! Pro VPN.exe" -connect',1)

But why use the CMD prompt at all instead of Run()?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You can send a cmd line threw run?

I want to connect using cmd not the actual program.

Share this post


Link to post
Share on other sites

... and the difference is what?

Everything I can use -changeip too :D thx ,1 fixed it.

Share this post


Link to post
Share on other sites

Everything I can use -changeip too :D thx ,1 fixed it.

That still doesn't explain what works on a CMD line that doesn't work with Run() or ShellExecute().

Be clear on what your commandline looks like and you might get a much simpler alternative from us.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0