sutefan Posted March 8, 2005 Posted March 8, 2005 (edited) Hello,I am new to autoit and downloaded on the recommendation from several sources including novell.com. As a network administrator one of my duties to ensure anti-virus is kept up to date, generally this taken care by central administration without any issues. This however does not help with remote users. Sophos the av provider recommendation was to create a batch file as follows, which uses wget to download a file before the update to processed. Can I achive the same result with AutoIt?The batch file we are currently using is as follows:@echo offC:CD C:\SOPHIDEDEL *.IDEDEL IDES.EXEWGET http://www.sophos.com/downloads/ide/ides.exeIDES.EXECOPY /Y *.IDE C:\Progra~1\Sophos~1\NET STOP SWEEPSRV.SYSNET START SWEEPSRV.SYSwget is a standalone program that resides in the same directory as the batch file and used to download the ides.exe file from Sophos' website.So far I've only done the helloworld and a small utility to display Computer Name and IP in a message box so my AutoIt knowledge is limited :"> Any help or suggestions appreciated!Sutefan Edited March 8, 2005 by sutefan これは私の署名であり, 私の名前はsutefan である !
SlimShady Posted March 8, 2005 Posted March 8, 2005 I just converted it for you. More info about the functions is available in the help file. FileDelete('C:\SOPHIDE\*.IDE') FileDelete('C:\SOPHIDE\IDES.EXE') InetGet('http://www.sophos.com/downloads/ide/ides.exe', 'C:\SOPHIDE\IDES.EXE', 1) RunWait('C:\SOPHIDE\IDES.EXE') FileCopy('C:\SOPHIDE\*.IDE', 'C:\Progra~1\Sophos~1\', 1) RunWait('NET STOP SWEEPSRV.SYS', '', @SW_HIDE) RunWait('NET START SWEEPSRV.SYS', '', @SW_HIDE)
sutefan Posted March 8, 2005 Author Posted March 8, 2005 Excellent Much appreciated Have some more questions but I want to lookup those functions so that I understand what's happening. Thanks Again Sutefan これは私の署名であり, 私の名前はsutefan である !
CyberSlug Posted March 8, 2005 Posted March 8, 2005 (edited) Based on SlimShady's post Line-by-line translation with closest equivalents. Untested, so be careful with FileDelete! #NoTrayIcon ; the C: line is not needed FileChangeDir("C:\SOPHIDE") FileDelete("*.IDE") FileDelete("IDES.EXE') RunWait("WGET http://www.sophos.com/downloads/ide/ides.exe","",@SW_HIDE) RunWait('C:\SOPHIDE\IDES.EXE') FileCopy('C:\SOPHIDE\*.IDE', 'C:\Progra~1\Sophos~1\', 1) RunWait('NET STOP SWEEPSRV.SYS', '', @SW_HIDE) RunWait('NET START SWEEPSRV.SYS', '', @SW_HIDE) Edited March 8, 2005 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
sutefan Posted March 9, 2005 Author Posted March 9, 2005 (edited) My first question Can Environmental Variables be used in AutoIt? So in this case for the above script I would want to replace all instances of C:\SOPHIDE with %TEMP% and %SystemDrive%. I've tried this but the Auto SyntaxCheck in SciTE says there are 0 error but when I do a check run it comes up with the following error: (5) : ==> Unable to execute the external program.: RunWait('%TEMP%\IDES.EXE') The system cannot find the file specified. I assume this is because there is no ides.exe file in %TEMP%. So I moved the FileDelete lines down to the bottom of the script so the files are deleted after the update is complete. This also fails with the same error as above. #NoTrayIcon InetGet('http://www.sophos.com/downloads/ide/ides.exe', '%TEMP%\IDES.EXE', 1) RunWait('%TEMP%\IDES.EXE') FileCopy('%TEMP%\*.IDE', '%SystemDrive%\Sophos~1\', 1) RunWait('NET STOP SWEEPSRV.SYS', '', @SW_HIDE) RunWait('NET START SWEEPSRV.SYS', '', @SW_HIDE) FileDelete('%TEMP%\*.IDE') FileDelete('%TEMP%\IDES.EXE') Sutefan Edited March 9, 2005 by sutefan これは私の署名であり, 私の名前はsutefan である !
webmedic Posted March 25, 2005 Posted March 25, 2005 I'm roughly guesing here but you will most likely have to set those up as variables. if FileExists("c:\windows\temp") then $temp = "c:\windows\temp" RunWait($temp & '\IDES.EXE') I'm really guessing here and have not tested the code at all.
Andre Posted March 25, 2005 Posted March 25, 2005 Hi, Sophos also provides RUS Remote Update Service....... for use with remote users. Works perfectly.... Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
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