Share this post

Link to post

Share on other sites

JLogan3o13 1,375

JLogan3o13 1,375

FOR /F "tokens=2*" %%A IN ('REG.EXE QUERY "HKLM\Software\Altiris\Altiris Agent" /V "installdir"') DO SET AgentDir=%%B
;Look at Registry Management in the help file
set tempbat=%temp%\AgentClean.bat"
;This is just a variable, $tempbat = <path>
echo "%AgentDir%\aexagentutil" /stop > %tempbat%
;Look at RunWait or ShellExecuteWait in the help file
echo rmdir "%AgentDir%\TaskManagement\cache" /s /q >> %tempbat%
echo rmdir "%AgentDir%\TaskManagement\status" /s /q >> %tempbat%
echo rmdir "%AgentDir%\TaskManagement\statusXml" /s /q >> %tempbat%
REM echo rmdir "%AgentDir%\TaskManagement\lti" /s /q >> %tempbat% -- remove away the REM, from this line only if you are running on 7.1 and above
;Look at DirRemove in the help file (sensing a pattern?)
echo ping localhost -n 30 >> %tempbat%
;Look at Ping in the help file
echo "%AgentDir%\aexagentutil" /start >> %tempbat%
;Look at RunWait or ShellExecuteWait in the help file
start "" /MIN %tempbat%
;Look at RunWait or ShellExecuteWait in the help file