Jump to content

Line 6 Error Help


Recommended Posts

Hello Everyone,

I am new to AutoIt Forum and the AutoIt program itself. I have created a .exe file that is returning an AutoIt Error when launching it.

Error:

Line 6 (File "here is the destination of the .exe file")

Error: Unknown function name.

I am wondering why I keep getting this error. I have tried using the Help from AutoIt, I've also researched the Forum, and I've tried Google. Any help would be greatly appreciated.

**I am using the new AutoIt version.

Thanks.

Link to comment
Share on other sites

When you run into an error, always reproduce it with an uncompiled script. The line number the exe file gives has been stripped from whitespace, comments, include lines, etc, so the line number the compiled exe shows is rarely the same in the uncompiled script.

Also, when posting for help try to add a piece of script that shows the error, otherwise it will be hard to help you.

Link to comment
Share on other sites

When you run into an error, always reproduce it with an uncompiled script. The line number the exe file gives has been stripped from whitespace, comments, include lines, etc, so the line number the compiled exe shows is rarely the same in the uncompiled script.

Also, when posting for help try to add a piece of script that shows the error, otherwise it will be hard to help you.

Hello,

I apologize for the late response. Thank you for your help though. I've attached an image of my error.

Thanks for your help.

post-59066-12797249934219_thumb.png

Edited by JHBP
Link to comment
Share on other sites

  • Moderators

JHBP,

The error is telling you that you have a line in your script which reads:

File "\\mvhfile01\sysshare\Xtext\WorkingJob.exe"

The error occurs because there is no such function as File in AutoIt and so the interpreter does not know what to do. :blink:

What do you want that line to do? Run the exe? Set the string as a variable?

Perhaps if you posted the uncompiled script it might make helping you easier. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

JHBP,

The error is telling you that you have a line in your script which reads:

File "\\mvhfile01\sysshare\Xtext\WorkingJob.exe"

The error occurs because there is no such function as File in AutoIt and so the interpreter does not know what to do. :blink:

What do you want that line to do? Run the exe? Set the string as a variable?

Perhaps if you posted the uncompiled script it might make helping you easier. ;)

M23

Thanks Melba! Yes, I am trying to run the .exe file. Here what I have:

If @LogonDomain = "our domain" then

; Store password in a variable

$PassWord = "Password1"

; Set Admin rights for any Run commands

RunAsSet("Username", "Domain", $PassWord)

EndIf

; Run the setup executable from the current folder

Run("\\mvhfile01\sysshare\xTest\Office.bat","",@SW_MAXIMIZE)

; Reset user's permissions

RunAsSet()

exit

If I run this script without it being compiled, it runs fine and I don't get an error. Hope you can tell me where I'm going wrong.

Thanks.

Link to comment
Share on other sites

  • Moderators

JHBP,

Hope you can tell me where I'm going wrong

Unlikely - as the script you posted above does not contain the line which causes the error. ;)

Are you sure that this is the script you compiled?

M23

P.S. When you post code please use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here). Or press the blue button just under the BOLD toolbar button.

And when you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read. :blink:

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

JHBP,

The error is telling you that you have a line in your script which reads:

File "\\mvhfile01\sysshare\Xtext\WorkingJob.exe"

The error occurs because there is no such function as File in AutoIt and so the interpreter does not know what to do. :blink:

What do you want that line to do? Run the exe? Set the string as a variable?

Perhaps if you posted the uncompiled script it might make helping you easier. ;)

M23

Thanks Melba! Yes, I am trying to run the .exe file. Here what I have:

If @LogonDomain = "our domain" then

; Store password in a variable

$PassWord = "Password1"

; Set Admin rights for any Run commands

RunAsSet("Username", "Domain", $PassWord)

EndIf

; Run the setup executable from the current folder

Run("\\mvhfile01\sysshare\xTest\Office.bat","",@SW_MAXIMIZE)

; Reset user's permissions

RunAsSet()

exit

If I run this script without it being compiled, it runs fine and I don't get an error. Hope you can tell me where I'm going wrong.

Thanks.

Link to comment
Share on other sites

  • Moderators

JHBP,

You have just posted the same text again! ;)

I repeat - the script you have now posted twice does NOT contain the line that is causing the error message you posted - so I cannot offer any help as to why you are getting the error.

In the script you have posted you use:

Run("\\mvhfile01\sysshare\xTest\Office.bat","",@SW_MAXIMIZE)

while the error you posted comes from a line:

File "\\mvhfile01\sysshare\Xtext\WorkingJob.exe"

Where is that line in your script? :blink:

M23

By the way, if you do want to run the batch file, you might want to try: :P

Run(@ComSpec & ' /c ' & '"\\mvhfile01\sysshare\xTest\Office.bat"', "", @SW_MAXIMIZE)

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

JHBP,

The error is telling you that you have a line in your script which reads:

File "\\mvhfile01\sysshare\Xtext\WorkingJob.exe"

The error occurs because there is no such function as File in AutoIt and so the interpreter does not know what to do. :blink:

What do you want that line to do? Run the exe? Set the string as a variable?

Perhaps if you posted the uncompiled script it might make helping you easier. ;)

M23

Thanks Melba! Yes, I am trying to run the .exe file. Here what I have:

If @LogonDomain = "our domain" then

; Store password in a variable

$PassWord = "Password1"

; Set Admin rights for any Run commands

RunAsSet("Username", "Domain", $PassWord)

EndIf

; Run the setup executable from the current folder

Run("\\mvhfile01\sysshare\xTest\Office.bat","",@SW_MAXIMIZE)

; Reset user's permissions

RunAsSet()

exit

If I run this script without it being compiled, it runs fine and I don't get an error. Hope you can tell me where I'm going wrong.

Thanks.

Link to comment
Share on other sites

Bot perhaps?

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Link to comment
Share on other sites

(File "\\mvhfile01\sysshare\Xtext\WorkingJob.exe")

I think that is the file that is executing which has the error in, although you get the line number from compiled script, you dont get any code from it.

Is this guys pester bot malfunctioning or what?

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I apologize for that. I was having issues posting my reply. :blink: In response to your question, I do not have a "File" line. The script I posted is everything I have for the job. I'm not sure why I would get that. The .bat file directory is correct in case you are wondering.

I compiled the scrip with the Run(@ComSpec.... and I am still getting the Line 6 error. Hmmmm ::thinking::

Edited by JHBP
Link to comment
Share on other sites

I am almost thinking about re-writing my script. I know the .bat file I've created works well. The reason I am using AutoIt is because I'd like to deploy this job to our users here at work who do not have Admin rights. By using AutoIt, I can input the RunAsSet command that will run the .bat file with Admin Credentials.

What do you guys think?

Thanks.

Link to comment
Share on other sites

There have been several sub versions of v3.

The current one is 3.3.6.1

RunAsSet was obsolete starting with v3.2.12.0

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Developers

I am using the latest one v3.

Thanks.

So, assuming you have loaded the full version of SciTE4AutoIt3, you should get warnings from au3check each time you hit F5 or F7.

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

Hello Everyone.

I apologize if I've stressed out some of you who are trying to help me. Yes, I do have v3.3.6.1. Before I posted on this Forum, I tried using the Help file from AutoIt, etc and I wasn't able to run a proper RunAs command until I found the one I posted earlier. I found it when searching in Google. I was not aware that my commands are obsolete now.

I don't expect anyone to hold my hand with this issue I am having. But if you can point me to the right direction where I can learn some RunAs commands in this Version of AutoIt, I would greatly appreciate it. Like I said, I am new to this so I am eager to learn the scripts and the mistakes that I make.

I ran the script by pressing F5 and the error that it is pointing to is my RunAsSet value that is in the script. Although, if I may add, I do not get an AutoIt error where it displays a Line 6 like I mentioned earlier. I hope this helps.

[Auto It Error]

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\JHBP\Desktop\AutoIt Scripts\WorkingJob.au3"

C:\Users\JHBP\Desktop\AutoIt Scripts\WorkingJob.au3 (12) : ==> Unknown function name.:

RunAsSet()

^ ERROR

>Exit code: 1 Time: 0.314

[/AutoIt Error]

Thank you.

Edited by JHBP
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...