Jump to content
YOUR-AD-HERE
HOSTING
TOOLS
SERVICE

Locked Pinned Frequently Asked Questions (FAQ) / Autoit help


DDoSer

Recommended Posts

1. How can I run a DOS program from within AutoIt?

If you wanted to run something like a DOS "Dir" command then you must run it though the command interpreter (command.com or cmd.exe depending on your OS). The @ComSpec macro contains the correct location of this file. You should use the RunWait() function as it waits for the DOS program to finish before continuing with the next line of the script. Here is an example of running the DOS Dir command on the C: drive: (effectively running the command command.com /c Dir C:\ )

This is the hidden content, please

 


 

2. Why can I only use Run() to execute .exe files? What about .msi / .txt and others?

Only a few file extensions are usually "runable" - these are .exe, .bat, .com, .pif. Other file types like .txt and .msi are actually executed with another program. When you double click on a "myfile.msi" file what actually happens in the background is that "msiexec.exe myfile.msi" is executed. So to run a .msi file from AutoIt you would do:

This is the hidden content, please

 

Or, run the command "start" which will automatically work out how to execute the file for you:

This is the hidden content, please

 

Or, use the ShellExecuteWait function which will automatically work out how to execute the file for you:

This is the hidden content, please

 


 

3. Why do I get errors when I try and use double quotes (") ?

If you want to use double-quotes inside a string then you must "double them up". So for every one quote you want you should use two. For example if you wanted to set a variable to the string: A word in "this" sentence has quotes around it! You would do:

This is the hidden content, please

or use single quotes instead:

This is the hidden content, please

 


 

4. What do the window "title" and "text" parameters mean?

There is a detailed description

This is the hidden content, please
.

 


 

5. Why can't I print a variable using "My var is $variable"?

If you have a variable called $msg and you want to print in inside a MsgBox then this will NOT work:

This is the hidden content, please

It will actually print My variable is $msg. What you need to do is tell AutoIt to join the string and the variable together using the & operator:

This is the hidden content, please

 

Advanced: If you have many variables to add into a string then you may find the StringFormat() function useful. For example, if I wanted to insert $var1 to $var5 into a string then it may be easier to do:

This is the hidden content, please

 


 

6. When I use Send() to send a variable odd things happen?

If you are sending the contents of a variable then be mindful that if it contains special send characters like ! ^ + {SPACE} then these will be translated into special keystrokes - rarely what is wanted. To overcome this use the RAW mode of Send() that does not translate special keys:

This is the hidden content, please

 


 

7. What is the difference between the return value and @error?

Generally a return value is used to indicate the success of a function. But, if a function is already returning something ( like WinGetText() ) then we need to have a way of working out if the function was successful, so we set @error instead.

 


 

8. How can I exit my script with a hot-key?

Ah, an easy one. If you want to make your script exit when you press a certain key combination then use the HotKeySet() function to make a user function run when the desired key is pressed. This user function should just contain the Exit keyword.

Here some code that will cause the script to exit when CTRL+ALT+x is pressed:

This is the hidden content, please

 


 

9. How can I use a custom icon when compiling my scripts?

You need to run the full compiler program (rather than just right-clicking a script and selecting compile). This page describes the compiler in detail.

 


 

10. How can I make sure only one copy of my script is run?

Use the _Singleton() function. See the User Defined Functions documentation for more information on _Singleton() and how to use it.

 


 

11. What are the current technical limits of AutoIt v3?

You can see it here

This is the hidden content, please

 


 

12. I get a missing picture symbol in the Help file under the Examples.

This should be the Open button that enable you to open the Examples in the Help file.

This issue is that the hhctrl.ocx isn't properly registered or corrupted.

Try registering it by doing "regsvr32 hhctrl.ocx" from the command prompt or check if the file is still valid.

 


 

You have question? Your code don't work correctly?

Ask for autoit v3 help HERE

Edited by DDoSer
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.