Jump to content

Recommended Posts

Posted

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

Posted

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:

Posted

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

Posted

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:

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
×
×
  • Create New...