JHBP Posted July 15, 2010 Posted July 15, 2010 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.
Tvern Posted July 15, 2010 Posted July 15, 2010 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.
JHBP Posted July 21, 2010 Author Posted July 21, 2010 (edited) 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. Edited July 21, 2010 by JHBP
Moderators Melba23 Posted July 21, 2010 Moderators Posted July 21, 2010 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. 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JHBP Posted July 21, 2010 Author Posted July 21, 2010 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. 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. M23Thanks 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 folderRun("\\mvhfile01\sysshare\xTest\Office.bat","",@SW_MAXIMIZE); Reset user's permissionsRunAsSet()exitIf 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.
Moderators Melba23 Posted July 21, 2010 Moderators Posted July 21, 2010 JHBP, Hope you can tell me where I'm going wrongUnlikely - 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. 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JHBP Posted July 21, 2010 Author Posted July 21, 2010 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. 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. M23Thanks 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 folderRun("\\mvhfile01\sysshare\xTest\Office.bat","",@SW_MAXIMIZE); Reset user's permissionsRunAsSet()exitIf 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.
Moderators Melba23 Posted July 21, 2010 Moderators Posted July 21, 2010 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? M23By the way, if you do want to run the batch file, you might want to try: Run(@ComSpec & ' /c ' & '"\\mvhfile01\sysshare\xTest\Office.bat"', "", @SW_MAXIMIZE) 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JHBP Posted July 21, 2010 Author Posted July 21, 2010 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. 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. M23Thanks 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 folderRun("\\mvhfile01\sysshare\xTest\Office.bat","",@SW_MAXIMIZE); Reset user's permissionsRunAsSet()exitIf 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.
LurchMan Posted July 21, 2010 Posted July 21, 2010 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.
JohnOne Posted July 21, 2010 Posted July 21, 2010 (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.
JHBP Posted July 21, 2010 Author Posted July 21, 2010 (edited) I apologize for that. I was having issues posting my reply. 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 July 21, 2010 by JHBP
JHBP Posted July 21, 2010 Author Posted July 21, 2010 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.
Developers Jos Posted July 21, 2010 Developers Posted July 21, 2010 What AutoIt3 version are you using? RunAsSet() is obsolete for a while. 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.
JHBP Posted July 21, 2010 Author Posted July 21, 2010 (edited) I am using the latest one v3. Thanks. Edited July 21, 2010 by JHBP
GEOSoft Posted July 21, 2010 Posted July 21, 2010 (edited) 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 July 21, 2010 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!"
Developers Jos Posted July 21, 2010 Developers Posted July 21, 2010 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.
JHBP Posted July 21, 2010 Author Posted July 21, 2010 (edited) 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 July 21, 2010 by JHBP
Developers Jos Posted July 21, 2010 Developers Posted July 21, 2010 What is your question that wasn't answered yet? 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now