Gerard

Hello World

16 posts in this topic

Wrote my first script and ran it on my desktop (Win 10/32bit)

#include MsgBoxConstants.au3
MsgBox($MB_OK,"My first program", "Hello World")

It errored

>"C:\Users\Linda F Newman\Desktop\..\autoit3.exe" /ErrorStdOut "C:\Users\Linda F Newman\Documents\AUTOIT\UtilityScripts\ListMacros.au3"    
'C:\Users\Linda' is not recognized as an internal or external command,
operable program or batch file.
>Exit code: 1
   

++++++++++++++++++++++++++++++++++

Copied script to my laptop (Win10/64) running the X86 version of AutoIt3.exe) and it worked perfectly.

 

Is there a config I am missing? The executables are in c:\Program Files\AutoIt3 folder on both machines and the "Hello World" scripts are in the UtilityScripts folder in "Documents\AUTOIT\UtilityScripts" on both machines.

 

Share this post


Link to post
Share on other sites



Certainly bad installation.

Under 64-bit OS the installation go to c:\Program Files (86)\AutoIt3 as opposed to c:\Program Files\AutoIt3 Under 32-bit OS

Share this post


Link to post
Share on other sites

The include statement needs brackets or quotes. 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks JPM

 

Didn't follow your well received advice. The script that is working is on the 64 bit opsys (although I am running the 32 bit version of AutoIt). The fail is on the 32 bit desktop.

Share this post


Link to post
Share on other sites

Sorry Water.

 

I followed your advice and ran

(#include MsgBoxConstants.au3)
MsgBox($MB_OK,"My first program", "Hello World")

 

No difference. Same error

Share this post


Link to post
Share on other sites
#include <MsgBoxConstants.au3>

Brackets, not parentheses, and you had them in the wrong place. Read the help file, it will definitely save you a lot of grief in the end.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
19 hours ago, Gerard said:

"C:\Users\Linda F Newman\Desktop\..\autoit3.exe"

This is not a standard installation but rather a zipfile download and unpack setup.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          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 are correct Jos but I downloaded the ZIP from the AutoIt site. Is there a difference in the end result. I assume I should uninstall and restart the whole process??? No problem if I need to do that.

Share this post


Link to post
Share on other sites

You can use it in portable mode as well as lang as you leave the directory structure in tack, but yes..  there are differences.

Is the autoit3.exe located in:  "C:\Users\Linda F Newman\autoit3.exe" ?

Jos


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

Share this post


Link to post
Share on other sites

Jos

 

Its in C:\Program Files\AutoIt3. I do not know why it picked up the User information and prepended it to the folder location.

Share this post


Link to post
Share on other sites

BrewManNH

Is this what you had in mind.

#include <MsgBoxConstants.au3>
MsgBox($MB_OK,"My first program", "Hello World")

Sadly it also failed.

Share this post


Link to post
Share on other sites

You didn't move the SciTE directory either?
What is the environment setting for variables like SCITE* ?  ( output of CMD window command: Set scite  )

Jos

 


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

Share this post


Link to post
Share on other sites

Jos, thanks for your continued help.

 

The SciTE directory is at the same level and location as AutoIt3.exe.
Since I am having difficulty with my very first script you wont be shocked to learn that I do not know anything about "environment settings" and the like.

Share this post


Link to post
Share on other sites

Open the dos prompt (CMD Window).

Type at the prompt (c:>):  SET scite   (Enter)

Cut&Paste the retuned value if any.

Jos 


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

Share this post


Link to post
Share on other sites

Here is the ENTIRE command prompt session

 

"Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Linda F Newman>SET scite
Environment variable scite not defined

C:\Users\Linda F Newman>c:\
'c:\' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Linda F Newman>c:

C:\Users\Linda F Newman>SET SciTE
Environment variable SciTE not defined

C:\Users\Linda F Newman>"

The variable appears to not have been defined.

Share this post


Link to post
Share on other sites

Ok, there is no environment variable defined. Currently no idea why it thinks that the autoit3 program is located in the user directory.

My recommendation would be to use the installer for both AutoIt3 and the SciTE4Autoit3 to ensure all setting for Registry and Environment are set correctly.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          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