Source code of Windows XP (NT5)
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

  1. $hhpfile = $ARGV[0];
  2. ($hhpfile) || die "Usage: RemovePathFromHHP.pl <HHP File>\n";
  3. if ( -f "$hhpfile.bak" ) {
  4. system ("del /f $hhpfile.bak");
  5. }
  6. rename ("$hhpfile", "$hhpfile.bak") ||
  7. die "Error renaming $hhpfile to $hhpfile.bak: $!.\n";
  8. open (INFILE, "<$hhpfile.bak") || die "Error opening file $hhpfile.bak: $!.\n";
  9. open (OUTFILE, ">$hhpfile") || die "Error opening file $hhpfile: $!.\n";
  10. print "\n$hhpfile...\n";
  11. while (<INFILE>) {
  12. s/(.*file=).*[\\|\/](.*)$/$1$2/;
  13. print OUTFILE;
  14. }
  15. close INFILE, OUTFILE;
  16. chmod 0444, "$hhpfile";
  17. if ( -f "$hhpfile.bak" ) {
  18. system ("del /f $hhpfile.bak");
  19. }
  20. exit 0;