OK, so melding together the discoveries and knowledge of these two hepcats - er, honorable monks - we might have something like this, maybe?
#!perl -w
use File::Find;
use Win32;
use strict;
find( \&wanted, "J:/ie5cache/Temporary Internet Files" );
sub wanted {
my $replacement = 'InfoTip="This is the IE cache folder"';
if ($_ eq 'desktop.ini') {
my $DOSname = Win32::GetShortPathName( "$File::Find::dir/$_" );
my $SRT = system( "ATTRIB -h -s -r $DOSname" );
warn "\nUh-oh, not going to work? -\n$!" if $SRT;
print( "Found $File::Find::dir/$_", qq[:\n]);
open( IEDF, "$File::Find::dir/$_") or die $!;
my @contents = <IEDF>;
close( IEDF ) or die $!;
if (@contents) {
for (@contents) {
s@UICLSID\=.+@$replacement\n@i;
}
open ( IEDF, ">$File::Find::dir/$_") or die $!;
print IEDF '',@contents,"\nreplacement made.\n";
print '',@contents;
close( IEDF ) or die $!;
}
}
}
There is only a little fruitfly in the ointment. The little line "InfoTip=This is the IE cache folder" does not seem to do anything in my Windows NT4 Explorer interface. Maybe this is (I think so) a Win98-specific innovation?
Good work anyway brothers, I like seeing my cache in ordinary perspective so I have some greater control over the contents.
Intrepid
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|