Jump to content

Recommended Posts


Posted

I grabbed WGET and made a batch as follows:

cmdow @ /HID
@echo off

for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\WIN51 set CDROM=%%i:

REM Download blocklist.reg
CALL %CDROM%\WGET\wget.exe -P %systemdrive%\Install -N http://www.spywareguide.com/blocklist.reg -q

EGEDIT /S %systemdrive%\Install\blocklist.reg

EXIT

This works good, but is there a way to apply the .reg only if the file contains some specified info on say line 5. some sort of IF COMP = OK apply .reg. Why I'm asking is because if someone should upload a bad blocklist.reg, I dont want it to be applied. Therefore comparing the files comments at the top before applying would be a good idea.

Posted

WGET.exe DOWNLOAD blocklist.reg TO %systemdrive%\install OVERWRITE IF NEWER ON SERVER

IF

COMPARE LINE 5 IN FILE %CDROM%\blocklist.reg %systemdrive%\install\blocklist.reg = OK

THEN

REGEDIT /S %systmedrive\install\blocklist.reg

ELSE

REGEDIT /S %CDROM%\blocklist.reg

END IF

EXIT

That's an explanation of what i want the batch to do.

Why? Simply check if the file that was automaticly downloaded has the same header (Line 5) for a bit security. I mean this script now just downloads and implements a .reg file regardless of content.

Posted

In circumstances like this I usually do a compare on the date modified property of the two files. I almost exclusively script with VBscript however so I'm not really sure how it would be done in batch.

The date created and date accessed are obviously useless, but the date modified is usually a pretty reliable method for comparison.

Posted
Yep, I am using the some method in my update batch script - it is comparing date of file on server and local machine...

and it's using timestamping for comparing the files

all i can say is that your batch files are working great

if you need to update alot of spyware, txt files and stuff like me, the soulin script's are made for you :thumbup

what i did use before whas this:

wget -q -t 2 -N https://netfiles.uiuc.edu/ehowes/www/res/ie-spyad.zip

unzip -q -o -u ie-spyad.zip -d temp

start /w REGEDIT /S temp\ie-ads-uninst.reg

start /w REGEDIT /S temp\ie-ads.reg

the one thing i cant figure out is, to let regedit only ad the reg files if they are new.(some sort of timestamping to)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...