kriss 0 Report post Posted January 10, 2006 (edited) HI,I need help, this is my scriptI 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 ExitElse MsgBox(16,"ePO Softwares Deployment Tool","Erreur Ligne 26")EndIfMsgBox(64,"ePO Softwares Deployment Tool",$final)ExitFunc 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 January 10, 2006 by kriss Share this post Link to post Share on other sites
MHz 72 Report post Posted January 10, 2006 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
kriss 0 Report post Posted January 11, 2006 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
MHz 72 Report post Posted January 11, 2006 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 helpSome existing code I have should help you perhaps. _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
kriss 0 Report post Posted January 12, 2006 Some existing code I have should help you perhaps. _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