I need your help for deleting a 16 digit long LOG file in the Windows Directory...

The file is called for example 7A86F4D98CF348A5.log

But I have a problem. The name of this log file difers on different machines but it is 16 digits long...

Any idea for a script deleting such a file?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
If the log file contains more or less the same information each time (perhaps a header?), you could build a script to open the file and test the contents. If the searched-for text exists, close the file and delete it.
Answered 09/16/2009 by: VBScab
Red Belt

Please log in to comment
0
the problem is that the 7A86F4D98CF348A5.log is different on another machine and is called ABCDF4D98CF348A5.log for example.

I need a way to search for the log file and then delete it, silently.
You must know that this log file is created by a third party application and it is something like a rootkit. I don't like to tell you what company does something like this. But it is as it is...

The content of the log file is like this:

Ûìl &®°J &®°J

Any ideas?
Answered 09/16/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
Yes, I got that. I should perhaps have been clearer. What I meant was to have your script build a list of ALL the .LOG files with names of 16 characters and open them one by one, testing for content.

From the content you've posted, it's either a binary file or in Unicode rather than ASCII. Either way, a decent text editor like TextPad can open it and show some humand-readable stuff which you can then use to determine any commonality.
Answered 09/17/2009 by: VBScab
Red Belt

Please log in to comment
0
I was able to open this file with a Hex Editor.
And the contents looks like this:


DBEC1E6C0000000026AEB04A0000000026AEB04A00000000


I don't know if it helps finding a solution...

But if you want to try to open it you can download the log file here:

http://www.FastShare.org/download/7A86F4D98CF348A5.log
/code]
Answered 09/17/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
Pretty much all the file-sharing sites are blocked by my current client so I can't d/l the example.

I don't know if it helps finding a solution... Only if there is some commonality in all the log files. For example, if the string 'DBEC1E6' appears in all log files which have 16 character names, then you can more or less state that these are candidates for deletion.
Answered 09/17/2009 by: VBScab
Red Belt

Please log in to comment
0
I'm waiting for the other log files from the other computers.
I'll be posting the contents, then...
Answered 09/17/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
But I'm not interested in the contents - you are! :)

What I'm advising is that if you can identify common characters appearing in log files with 16 character names, then you have probably identified the target.
Answered 09/17/2009 by: VBScab
Red Belt

Please log in to comment
0
It seems to be a binary log file or something...
The first characters in the log file seem to be the same on each computer.
Like you said VBScab. The characters in the log files are : DBEC1E6

So, how can one search for such a binary nonsense and delete it?
Answered 09/17/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
Use the FileSystemObject object's OpenAsTextStream method to create an target file object. Dump the file into a string variable using the .Read method against that object. Then all you have to do is search the string. To make life simple, make your search term upper-case and convert what you read to upper-case too before making the comparison.

Lots and lots of script examples around which deal with opening and searching text files so you can use the logic from those and adapt it to suit. Yes, your file is binary but trust me, OpenAsTextStream is happy to handle it.
Answered 09/17/2009 by: VBScab
Red Belt

Please log in to comment
0
I need your help for deleting a 16 digit long LOG file in the Windows Directory...

The file is called for example 7A86F4D98CF348A5.log


If you don't want to open the files, you could always try matching the filenames to a regular expression.
In this case I think something along the lines of "^[A-Za-z0-9]{16}" should do the trick for the first part of the filename.

Just test all filenames in the folder for a regex match. If you get one, delete and continue.

EDIT: did some more looking, I think the regex you want is "^[a-zA-Z0-9]{16}\.[lL][oO][gG]$" for the full filename.

PJ
Answered 09/17/2009 by: pjgeutjens
Red Belt

Please log in to comment
0
The problem with that - and the reason I suggested content-checking - is that a file called, for example, 'ReallyCrucial22.log' would get deleted.
Answered 09/17/2009 by: VBScab
Red Belt

Please log in to comment
0
The problem with that - and the reason I suggested content-checking - is that a file called, for example, 'ReallyCrucial22.log' would get deleted.

Good point, but at the very least you could limit the number of files you'd have to check [;)]
Answered 09/17/2009 by: pjgeutjens
Red Belt

Please log in to comment
0
Can anyone provide me with a script file? Because I'm now totally stuck...
Answered 09/17/2009 by: McRip
Orange Senior Belt

Please log in to comment
0
Quite so.
Answered 09/17/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity