Jump to content

Recommended Posts

Posted

Hello,

I try to run in c++ this command line for autoit :

CreateProcess(0, "AutoIt3.exe /AutoIt3ExecuteLine \"MsgBox(0x0,''AutoIt'',''This is my script.'')\"", 0, 0, 0, 0, 0, 0, &si, &pi);

This code return : Missing separator character after keyword. It's a problem with the quotation marks but i don't know how to solve this error.

Thanks.

Posted (edited)

I don't know what Create Process is in C++... but can you try this?

CreateProcess(0, "AutoIt3.exe /AutoIt3ExecuteLine  'MsgBox(0, ''Hello World!'', ''Hi!'')'", 0, 0, 0, 0, 0, 0, &si, &pi);

or maybe this

CreateProcess(0, 'AutoIt3.exe /AutoIt3ExecuteLine  "MsgBox(0, ''Hello World!'', ''Hi!'')"', 0, 0, 0, 0, 0, 0, &si, &pi);
Edited by Nahuel
  • Developers
Posted (edited)

Don't think you need the double '' in there... try:

CreateProcess(0, "AutoIt3.exe /AutoIt3ExecuteLine \"MsgBox(0x0,'AutoIt','This is my script.')\"", 0, 0, 0, 0, 0, 0, &si, &pi);

Edited by 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.
  :)

  • 2 years later...
Posted

I would like to add that the AutoIt3ExecuteLine sample at

http://www.autoitscript.com/autoit3/docs/intro/running.htm

says

To execute a single line of code, use the command:

Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Hello World!'', ''Hi!'')"')

The tray icon will not be displayed when using /AutoIt3ExecuteLine

NOTE: Correct usage of single- and double- quotation marks is important, even double single.

appears to specifically (and incorrectly) assert that double single quotes are necessary. I'm glad I found this post.

Posted

No, it doesn't. It correctly cautions you to use them correctly.

Please don't resurrect old topics like that.

If you must, start a new topic and refer to the old one with a link.

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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
  • Recently Browsing   0 members

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