Jump to content

Error: Illega text at the end of statement (one statement per line)


Recommended Posts

Hello this has been driving me crazy I am trying to build a script that will check the OS arch and apply the correct service pack 2 for Office 2010. When i compile this I do not recieve any errors, but after i run the EXE i get this AutoIT error.

Line 28 (File""):

Error: Illega text at the end of statement (one statement per line)

 

Here is my code. Thanks

-------------------------------------------------------------------------------------------------------------------------------------------

AutoItSetOption("TrayIconHide",1)

$SilentInstall = False
$installDir = "C:AdminAppUpdOffice Pro 2010 SP2"
$logFile = $installDir & "" & @ScriptName & ".log"
$logFileSubApp = $installDir & "" & @ScriptName & "_bundled_app.log"
$appTitle = "Office Pro 2010 SP2"
$ret = 0

;command options
if $cmdLine[0] > 0 then
    for $a = 1 to $cmdLine[0]
        if StringLeft($cmdLine[$a],1) = "-" then
            $cmdLine[$a] = "/" & StringMid($cmdLine[$a],1)
        EndIf

        Switch $cmdLine[$a]
            Case "/s", "/q", "/silent", "/quiet"
                $SilentInstall = True

        EndSwitch
    Next
EndIf



;start the log
DirCreate($installDir)

if not $SilentInstall then ProgressOn($appTitle,"Staging Files","Please Wait...",-1,-1,16)

;stage the files
FileInstall("officesp2010-kb2687455-fullfile-x86-en-us.exe",$installDir & "officesp2010-kb2687455-fullfile-x86-en-us.exe")



If @OSArch = "x86" Then

;run the command
ProgressSet(100,"Installing Office Pro 2010 SP2")
RunWait('"' & $installDir & 'officesp2010-kb2687455-fullfile-x86-en-us.exe /quiet"')
_Log("Install returned " & $ret & ", @err=" & @error & ", @ext=" & @extended)

Else @OSArch = "x64" Then

ProgressSet(100,"Installing Office Pro 2010 SP2")
RunWait('"' & $installDir & 'officesp2010-kb2687455-fullfile-x64-en-us.exe /quiet"')

EndIf


prompt if not silent
ProgressOff()
if not $SilentInstall Then _ShowUserPrompt($ret)


exit $ret

Link to comment
Share on other sites

  • Moderators

rbenner1184,

A couple of obvious problems:

Else @OSArch = "x64" Then

; should be 

ElseIf @OSArch = "x64" Then

; And

prompt if not silent

; should be 

; prompt if not silent
Try amending those and see if it fixes the problem. ;)

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

  • Moderators

rbenner1184,

 

I look at code all day so some times my brain just gets fried after a while

I know the feeling! :D

Glad I could help. :)

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

BTW: Could you please put your script code in AutoIt tags (the blue "A" icon in the editor) - greatly enhances readability :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

No need to apologize :)

We learn something new every day.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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...