Re: Iterations

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 12/28/04


Date: Tue, 28 Dec 2004 14:36:09 -0700


"stev379" <stev379@discussions.microsoft.com> wrote in message
news:5D5EF6F8-23DC-4AA3-A56B-C04DA192F661@microsoft.com...
> This is pointing me in the correct direction.
> My users tend to invite a lot (very very much) of spyware. I'm finding
new
> things everyday that most spyware/adware removal tools don't cover. I'd
like
> to build this portion of the script to go through an array of files, and
> delete them, such that I can easily add to the list without having to edit
> large portions of a script for each file.

Ok, so if you want to delete the files, are you sure that that will fix the
problem? Perhaps the contents have already been installed, and the file is
only an artifact.

A few things to think about:

- what O/S's run on your clients? If w2k XP and up, then I would recommend
that, instead of running this code at each individual workstation that you
run it from an admin workstation. There are a number of ways that this could
be done...

- are you expecting to remain current by adding to your "bad-file" list only
what you run across and personally verify as malware? I would recommend
investigating various packages that can do this a little more automatically
for you.

- are you expecting to safely continue to detect bad files simply by the
filenames they arrive in?

> Due to my organizations policies, politics and language barriers, training
> the users to not drag their feet as they browse the web is not a viable
> option.

Agreed. But even in the simplest of environments, relying on user training
as the primary defence against adware is foolhardy.

> I enjoy building such scripts in my free time and figure I can learn along
> the way.

There is no way you can script without learning something. I would only warn
you that you need to put more emphasis on the task of protecting your
infrastructure than on the importance of being the one to save the day with
scripting.

/Al

> Thanks again for any more help you can offer.
>
> "Al Dunbar [MS-MVP]" wrote:
>
> >
> > "stev379" <stev379@discussions.microsoft.com> wrote in message
> > news:B393ED58-6E39-4022-9C9C-B88DE08A97F5@microsoft.com...
> > > I'm building a script to find and log specific file names on a PC.
> >
> > According to what you write below, you are not looking for specific
> > filenames so much as specific files, as you are looking only in the root
> > folder. Perhaps if you gave some details about what it is you want to do
> > when you find these files in existence, there might be a way to get
closer
> > to your intended result than to just provide a list of which files exist
and
> > which don't.
> >
> > > The way I
> > > would do it now is just to rewrite the logging portion. I think there
is
> > a
> > > way to loop and have it count through so it uses a different file name
> > each
> > > time.How can I set it so it will go through iterations by the file
names?
> > > So if the filenames were "filename1, filename2, filename3 etc.", it
may
> > use
> > > somethinglike
> > > filename0 (0)
> > > filename1(1)
> > > filename2(2)
> >
> > Method 1:
> >
> > filenames = array( _
> > "lions.txt", _
> > "tigers.txt", _
> > "bears.txt", _
> > "Oh my!.txt" _
> > )
> >
> > for each filename in filenames
> > ' your code goes here
> > next
> >
> > Method 2:
> >
> > call filecheck("lions.txt")
> > call filecheck("tigers.txt")
> > call filecheck("bears.txt")
> > call filecheck("Oh my!.txt")
> > wscript.quit
> >
> > sub filecheck(filename)
> > ' your code goes here
> > end sub
> >
> > > 'My current example with just rewritting the script over an over:
> > > LogFile = "C:\Testing.txt"
> > > Set f = objFSO.OpenTextFile(LogFile, ForAppending, True)
> > > If objFSO.FileExists("C:\filename0.exe")=True Then
> > > f.WriteLine Now & ";" & WshNetwork.ComputerName & ";" & "Success" &
";" &
> > > Err.Description
> > > Else
> > > f.WriteLine Now & ";" & WshNetwork.ComputerName & ";" & "Failure" &
";" &
> > > Err.Description
> > > Err.Clear
> > > End If
> > >
> > > If objFSO.FileExists("C:\filename1.exe")=True Then
> > > f.WriteLine Now & ";" & WshNetwork.ComputerName & ";" & "Success" &
";" &
> > > Err.Description
> > > Else
> > > f.WriteLine Now & ";" & WshNetwork.ComputerName & ";" & "Failure" &
";" &
> > > Err.Description
> > > Err.Clear
> > > End If
> > >
> > > 'End script
> > >
> > > Thanks for any help or suggestions!
> > > -Steve
> >
> >
> >



Relevant Pages

  • Re: Iterations
    ... My users tend to invite a lot of spyware. ... large portions of a script for each file. ... > filenames so much as specific files, as you are looking only in the root ... >> would do it now is just to rewrite the logging portion. ...
    (microsoft.public.windows.server.scripting)
  • Re: Scripting and Windows AntiSpyware (Beta)
    ... It's not going to stop spyware for very long. ... and never go on the internet if you're logged on ... autoacceptanythingyouwanttorunonmysystem and their support is the dealer ... Technet Script Center - http://www.microsoft.com/technet/scriptcenter/ ...
    (microsoft.public.scripting.vbscript)
  • Re: Scripting and Windows AntiSpyware (Beta)
    ... It's not going to stop spyware for very long. ... and never go on the internet if you're logged on ... autoacceptanythingyouwanttorunonmysystem and their support is the dealer ... Technet Script Center - http://www.microsoft.com/technet/scriptcenter/ ...
    (microsoft.public.windows.server.scripting)
  • Re: Scripting and Windows AntiSpyware (Beta)
    ... It's not going to stop spyware for very long. ... and never go on the internet if you're logged on ... autoacceptanythingyouwanttorunonmysystem and their support is the dealer ... Technet Script Center - http://www.microsoft.com/technet/scriptcenter/ ...
    (microsoft.public.scripting.wsh)
  • Re: Scripting and Windows AntiSpyware (Beta)
    ... It's not going to stop spyware for very long. ... and never go on the internet if you're logged on ... autoacceptanythingyouwanttorunonmysystem and their support is the dealer ... Technet Script Center - http://www.microsoft.com/technet/scriptcenter/ ...
    (microsoft.public.scripting.jscript)