Need help for deleting a special LOG file
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?
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
Answers (14)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
Posted by:
McRip
15 years ago
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:
Any ideas?
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?
Posted by:
anonymous_9363
15 years ago
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.
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.
Posted by:
McRip
15 years ago
I was able to open this file with a Hex Editor.
And the contents looks like this:
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:
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]
Posted by:
anonymous_9363
15 years ago
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.
Posted by:
McRip
15 years ago
Posted by:
anonymous_9363
15 years ago
Posted by:
McRip
15 years ago
Posted by:
anonymous_9363
15 years ago
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.
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.
Posted by:
pjgeutjens
15 years ago
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
Posted by:
anonymous_9363
15 years ago
Posted by:
pjgeutjens
15 years ago
Posted by:
McRip
15 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.