FATIHTALI Posted March 23, 2009 Share Posted March 23, 2009 (edited) Hello. I want to share my Startup Agent with you. I made it for Windows Sp3 and install some programs. Program every restart working. I put it All Users\startup with psexec. Also program has heart beath... I am not good at programing. Program can be more easy or can be better. In the factory it is working 1200 computer now. Next week it will be in near 2000 computer... 1-Program opening and reading Server side ini file. 2-It is converting to array it. 3-It is cheking pc side ini file. 4-If it is not exist creating file. 5-It is making second array from pc side ini file. 6-Program compairing two ini file. 7-If can be found different things It is running with admin account. I am writing full path of program to server side ini. \\server\agent\sp3\sp3.exe program made from AutoIt also silent... \\server\agent\flash10\flash10.exe program made from AutoIt also silent... CODE ; ---------------------------------------------------------------------------- ; AutoIt Version: v3.2.10.0 ; Author: Fatih TALI ; Script Function: Intall programs ; ---------------------------------------------------------------------------- #include <file.au3> #Include <Array.au3> Dim $serverARRAY Dim $pcARRAY $USERNAME = "xxxxxx" $DOMAIN = "xxxxxx" $PASSWORD ="xxxxx" $date =@MDAY&"."&@MON&"."&@YEAR&"."&@HOUR&":"&@MIN&":"&@SEC Opt("TrayIconHide", 1) ;un-hide the icon FileWriteLine("\\server\Utility\agent\agent.log",""&@ComputerName&".domain.local,"&@OSVersion&","&@OSServicePack&","&$date) ;---------------hearth beet ; reading server side ini. If Not _FileReadToArray("\\server\Utility\agent\jobs.ini",$serverARRAY) Then Exit EndIf if not FileExists("C:\SYSTEM\JObs_PC.ini") Then DirCreate ( "C:\SYSTEM" ) _FileCreate("C:\SYSTEM\JObs_PC.ini") $file = FileOpen("C:\SYSTEM\JObs_PC.ini", 1) FileWriteLine($file ,"[--------------------------------------------------------------------------]") FileWriteLine($file ,"[..Plese dont change this file. If you change program can not work well....]") FileWriteLine($file ,"[-----------------------Only restrict people can change--------------------]") FileWriteLine($file ,"[--------------------------------------------------------------------------]") FileClose($file) EndIf ;-------server side file reading and making array from it. If Not _FileReadToArray("C:\SYSTEM\JObs_PC.ini",$pcARRAY) Then ; MsgBox(16,"Error.", "c:\SYSTEM couldnt creat or reding error..." ) Exit EndIf ;--- comparing arrays For $x = 5 to $serverARRAY[0] $Flag = 0 For $y = 5 to $pcARRAY[0] If $serverARRAY[$x]=$pcARRAY[$y] then $Flag = 1 ExitLoop endif Next if $flag = 0 then RunASWait($USERNAME,$DOMAIN,$PASSWORD,0,$serverARRAY[$x], @SystemDir) Endif Next Exit agent.au3 Edited June 2, 2023 by FATIHTALI Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now