Jump to content

error message


kriss
 Share

Recommended Posts

HI,

I need help, this is my script

I have an error message on this line "$cmdline = @ComSpec & " /c net user epoagent Epo15/* /add /PASSWORDCHG:NO"

Thanks

; ---------------------------------------------------------

; Starting

; ---------------------------------------------------------

$answer=MsgBox(1,"ePO Softwares Deployment Tool","Please Confirm that you report to the ePO Server")

If $answer=1 Then

ProgressOn ( "ePO Softwares Deployment Tool", "Installation of ePOAgent")

$epo = epo_deploy()

ProgressSet ( 99, "Installation in progress... 100%", "Installation process done")

$epo = epo_deploy()

$final = "Installation report :" & @CRLF & _

"ePO : " & $epo & @CRLF & _

ProgressOff()

ElseIf $answer=2 Then

Exit

Else

MsgBox(16,"ePO Softwares Deployment Tool","Erreur Ligne 26")

EndIf

MsgBox(64,"ePO Softwares Deployment Tool",$final)

Exit

Func epo_deploy ()

FileInstall ( "C:\au_includes\FramePkg.exe", @TempDir & "\FramePkg.exe", 1 )

If @OSType="WIN32_NT" Then

; ---------------------------------------

; Ajout du user epoagent

; ---------------------------------------

$cmdline = @ComSpec & " /c net user epoagent Epo15/* /add /PASSWORDCHG:NO"

$cmdok = RunWait ( $cmdline, "", @SW_HIDE )

$cmdline = @ComSpec & " /c net localgroup administrateurs epoagent /add"

$cmdok = RunWait ( $cmdline, "", @SW_HIDE )

$cmdline = @ComSpec & " /c net localgroup administrators epoagent /add"

$cmdok = RunWait ( $cmdline, "", @SW_HIDE )

; ---------------------------------------

; installation de epo agent pour WIN32+

; ---------------------------------------

$cmdline = @ComSpec & " /c """ & @TempDir & "\FramePkg.exe"" /install=agent /silent"

$cmdinstall = RunWait ( $cmdline, "", @SW_HIDE )

; ---------------------------------------

; Suppression du user epoagent

; ---------------------------------------

$cmdline = @ComSpec & " /c net user epoagent /delete"

$cmdok = RunWait ( $cmdline, "", @SW_HIDE )

If $cmdinstall = 0 Then

$returnmessage = "ePO Software successfully installed..."

Else

$returnmessage = "An error has occured with the agent installation..."

EndIf

Else

; ---------------------------------------

; installation de epo agent pour W9x

; ---------------------------------------

$cmdline = @ComSpec & " /c """ & @TempDir & "\FramePkg.exe"" /install=agent /silent"

$cmdinstall = RunWait ( $cmdline, "", @SW_HIDE )

If $cmdinstall = 0 Then

$returnmessage = "ePO Software successfully installed..."

Else

$returnmessage = "An error has occured with the agent installation..."

EndIf

EndIf

FileDelete ( @TempDir & "\FramePkg.exe" )

return $returnmessage

EndFunc

Edited by kriss
Link to comment
Share on other sites

To support what Larry advises, have a look here.

$cmdline and also $cmdlineraw are reserved for incoming parameters.

Hi,

have you an idea to create my user "epoagent" and include this process in my script.

My script create an user "epoagent", run framepkg.exe and delete "epoagent" user.

Thanks for your help

Link to comment
Share on other sites

Hi,

have you an idea to create my user "epoagent" and include this process in my script.

My script create an user "epoagent", run framepkg.exe and delete "epoagent" user.

Thanks for your help

Some existing code I have should help you perhaps. :lmao:

_NetUser('epoagent')

; run framepkg.exe

RunWait(@ComSpec & ' /c Net User epoagent /Delete', '', @SW_HIDE)


Func _NetUser($name, $password = '', $groupname = '', $autologon = 0)
    If $groupname = '' Then $groupname = 'Administrators'
    Local $key
    If Not FileExists(EnvGet('AllUsersProfile') & '\..\' & $name) Then
        RunWait(@ComSpec & ' /c ' & _
                'Net User ' & $name & ' ' & $password & ' /add &&' & _
                'Net LocalGroup ' & $groupname & ' ' & $name & ' /add &' & _
                'Net Accounts /MaxPwAge:UnLimited', '', @SW_HIDE)
        If $autologon Then
            $key = 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
            RegWrite($key, 'DefaultUserName', 'Reg_sz', $name)
            RegWrite($key, 'DefaultPassword', 'Reg_sz', $password)
            RegWrite($key, 'AutoAdminLogon', 'Reg_sz', 1)
        EndIf
    EndIf
EndFunc
Link to comment
Share on other sites

Some existing code I have should help you perhaps. :lmao:

_NetUser('epoagent')

; run framepkg.exe

RunWait(@ComSpec & ' /c Net User epoagent /Delete', '', @SW_HIDE)
Func _NetUser($name, $password = '', $groupname = '', $autologon = 0)
    If $groupname = '' Then $groupname = 'Administrators'
    Local $key
    If Not FileExists(EnvGet('AllUsersProfile') & '\..\' & $name) Then
        RunWait(@ComSpec & ' /c ' & _
                'Net User ' & $name & ' ' & $password & ' /add &&' & _
                'Net LocalGroup ' & $groupname & ' ' & $name & ' /add &' & _
                'Net Accounts /MaxPwAge:UnLimited', '', @SW_HIDE)
        If $autologon Then
            $key = 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
            RegWrite($key, 'DefaultUserName', 'Reg_sz', $name)
            RegWrite($key, 'DefaultPassword', 'Reg_sz', $password)
            RegWrite($key, 'AutoAdminLogon', 'Reg_sz', 1)
        EndIf
    EndIf
EndFunc
Thanks
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...