Leaked source code of windows server 2003
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.

37 lines
772 B

  1. #!perl
  2. use strict;
  3. use warnings;
  4. eval {
  5. unless (Win32::IsWin95()) {
  6. die "This only works on Windows 9x.\n";
  7. }
  8. unless ($ENV{winbootdir}) {
  9. die "No winbootdir environment variable. Unable to continue.\n";
  10. }
  11. my $autoexec = substr($ENV{winbootdir},0,2) .'\autoexec.bat';
  12. my $perl = $^X;
  13. $perl =~ s|\\.?perl.exe$||i;
  14. if ($perl =~ /\s/) {
  15. $perl = "\"$perl\"";
  16. }
  17. if (-e $autoexec && ! -w $autoexec) {
  18. chmod 0755, $autoexec
  19. or die "Unable to make $autoexec writable: $!\n";
  20. }
  21. open(F, ">>$autoexec")
  22. or die "Unable to open $autoexec for writing: $!\n";
  23. print F "\nSET PATH=$perl;%PATH%\n";
  24. close F
  25. or die "Error closing filehandle: $!\n";
  26. };
  27. warn $@ if $@;