mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
624 B
27 lines
624 B
$hhpfile = $ARGV[0];
|
|
|
|
($hhpfile) || die "Usage: RemovePathFromHHP.pl <HHP File>\n";
|
|
|
|
if ( -f "$hhpfile.bak" ) {
|
|
system ("del /f $hhpfile.bak");
|
|
}
|
|
|
|
rename ("$hhpfile", "$hhpfile.bak") ||
|
|
die "Error renaming $hhpfile to $hhpfile.bak: $!.\n";
|
|
|
|
open (INFILE, "<$hhpfile.bak") || die "Error opening file $hhpfile.bak: $!.\n";
|
|
open (OUTFILE, ">$hhpfile") || die "Error opening file $hhpfile: $!.\n";
|
|
print "\n$hhpfile...\n";
|
|
|
|
while (<INFILE>) {
|
|
s/(.*file=).*[\\|\/](.*)$/$1$2/;
|
|
print OUTFILE;
|
|
}
|
|
close INFILE, OUTFILE;
|
|
chmod 0444, "$hhpfile";
|
|
|
|
if ( -f "$hhpfile.bak" ) {
|
|
system ("del /f $hhpfile.bak");
|
|
}
|
|
|
|
exit 0;
|