Sign in to follow this  
Followers 0
daniel_lsl

Error: Unable to execute the external program

6 posts in this topic

Hi All,

I've facing a problem with this script and would appreciate any help or advice here. Please see attached the error message when I run the script.

I've attached a part of my script to this message:

#include <file.au3>
#include <date.au3>

Opt("TrayIconDebug", 0) 

dim $file, $ErrVal, $file1, $WinEx, $Count

; Set the RunAs parameters to use local adminstrator account
RunAsSet("administrator", @Computername, "admin01")

If FileExists("C:\WINNT\Temp\UnAlt-ok.log") = 1 Then
    $ErrVal = FileCopy("C:\WINNT\Temp\UnAlt-ok.log", @AppDataCommonDir)
    If $ErrVal = 0 Then 
        Errorlog("Cannot Copy UnAlt-ok.log")
    EndIf
EndIf   

If FileExists("C:\WINNT\Temp\AlCollection.ini") = 1 Then
    $ErrVal = FileCopy("C:\WINNT\Temp\AlCollection.ini", @AppDataCommonDir)
    If $ErrVal = 0 Then 
        Errorlog("Cannot Copy AlCollection.ini")
    EndIf
EndIf   

If FileExists(@AppDataCommonDir & "\UnAlt-ok.log") = 0 Or FileExists("C:\Program Files\Altiris\Altiris Agent\Client Policies\xxxx.xml") = 1 Then
    
; Run Altiris Cleanup
    If FileExists("C:\Program Files\Altiris\Altiris Agent\AeXAgentUtil.exe") = 1 Then
        $ErrVal = RunWait(chr(34)&"C:\Program Files\Altiris\Altiris Agent\AeXAgentUtil.exe"&chr(34)& " /clean")
        If $ErrVal <> 0 Then
            Errorlog("Error running AexAgentUtil.exe")
            MsgBox(0,"Warning", "Uninstallation Failed ! Please check with IT Helpdesk")
            Exit
        EndIf
    Else
    ;No existing Altiris Client, install new client
        InstallNew()
    EndIf

Thanks in advance.

post-17767-1163042634_thumb.jpg

Share this post


Link to post
Share on other sites



Hi gafrost,

Your recommendation works. Thank you. Really appreciate it.

Share this post


Link to post
Share on other sites

Hi,

To avoid errors later you should also check out the AutoIt's directory macros. You find them in the help file autoit->Macro Reference->Directory macros-[@windowsDir|@ProgramFilesDir]

Just a my two cents.:whistle:

Share this post


Link to post
Share on other sites

Hi qafrost,

The recommendation works however I've some PCs is Japan giving this problem. Please see my script below.

$ErrVal = RunWait(@AppDataCommonDir & '\AeXNSC.exe -s -a ns="apns2.basf-sea.com.sg" NOSTARTMENU NOTRAYICON /s')

Any advice? Thanks.

post-17767-1163467608_thumb.gif

Share this post


Link to post
Share on other sites

Add double quotes around the path to the file.

$ErrVal = RunWait('"' & @AppDataCommonDir & '\AeXNSC.exe" -s -a ns="apns2.basf-sea.com.sg" NOSTARTMENU NOTRAYICON /s')

Looks like a Japanese OS does no use backslashes but an alternative character. Hopefully the code may still work fine.

:whistle:

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
Sign in to follow this  
Followers 0