nettech27 Posted September 27, 2011 Share Posted September 27, 2011 I'm new to AutoIT and new to scripting so bare with me...I'm trying to write the results to a log file from running a setup.exe. My batch script works but I don't know how to take the same commands and run it in AutoIT. Is there anyone who can help me or point me in the right direction? Here's my batch script: rem @echo offcomputername > "\\Myshare\Altiris\Logs\%computername%.log"start "Altiris Agent Uninstall" /MIN /wait "C:\Program Files\Altiris\Altiris Agent\AeXAgentUtil.exe" /clean >> "\\Myshare\Altiris\Logs\uninstall_%computername%.log"echo Altiris Agent Uninstalled on %computername% >> "\\Myshare\Altiris\Logs\uninstall_%computername%.log"start "Altiris Agent Install" /MIN /wait "\\Myshare\Altiris\AeXNSC.exe" /install /ns=cms01.good.org /s >>"\\Myshare\Altiris\Logs\re-installed_%computername%.log"echo Altiris Agent installed on %computername% >> "\\Myshare\Altiris\Logs\%computername%.log" Here's what I'm trying to do in AutoIT:; ----------------------------------------------------------------------------------------------------------------------------------------------; Stops Altiris Agent ProcessIf ProcessExists("AeXAgentUIHost.exe") Then ProcessClose("AeXAgentUIHost.exe")EndIfIf ProcessExists("AeXNSAgent.exe") Then ProcessClose("AeXNSAgent.exe")EndIf; ----------------------------------------------------------------------------------------------------------------------------------------------; Uninstalls Altiris SMARunWait("start ""Altiris Agent Uninstall""/MIN /wait ""C:\Program Files\Altiris\Altiris Agent\AeXAgentUtil.exe"" /clean /li ""\\Myshare\Altiris\uninstall_%computername%.log") - Can't get this part to work...even if I replace with: RunWait("C:\Program Files\Altiris\Altiris Agent\AexAgentUtil.exe"" /clean")DirRemove("C:\Program Files\Altiris"); ----------------------------------------------------------------------------------------------------------------------------------------------; Installs Altiris SMARunWait(""\\Myshare\Altiris\AeXNSC.exe" /install /ns=cms01.good.org /s /li ""\\Myshare\Altiris\re-install_%computername%.log") - Can't get the log of the executable file.; ----------------------------------------------------------------------------------------------------------------------------------------------; End ScriptExit Link to comment Share on other sites More sharing options...
sleepydvdr Posted September 27, 2011 Share Posted September 27, 2011 (edited) _FileWriteLog is probably what you want. You don't even need to create the log file first - it will do that for you. Here's an example: #include <File.au3> _FileWriteLog ("Mylog.log", "Step 1: Process Killed - " & @ComputerName) Edited September 27, 2011 by sleepydvdr #include <ByteMe.au3> 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