Jump to content

Send() is not sending full line of code.


Recommended Posts

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!

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...