Sign in to follow this  
Followers 0
kriss

error message

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



To support what Larry advises, have a look here.

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

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