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.

102 lines
2.4 KiB

  1. @rem = '
  2. @goto endofperl
  3. ';
  4. #+---------------------------------------------------------------------------
  5. #
  6. # File: R U N W 3 2 . B A T
  7. #
  8. # Contents: Perl/cmd script to prevent fatal page fault when using Win9x
  9. # and running winnt32.exe from a network share.
  10. #
  11. # Author: kumarp 21-August-98
  12. #
  13. # Notes:
  14. # Windows95 does not allow an executable on a network share to be copied
  15. # to pagefile before executing it, it simply runs it directly
  16. # from the network share. In case of a network problem, this results
  17. # in a fatal pagefault error.
  18. #
  19. # This script is written with the aim to avoid this problem when
  20. # running winnt32.exe from the ntbuilds release shares. It simply
  21. # copies all winnt32.exe files (~ 4MB) to a temporary directory on the
  22. # local hard drive. It does not copy the entire release share to your
  23. # hard drive. It then launches winnt32.exe from the local hard drive.
  24. #
  25. #----------------------------------------------------------------------------
  26. my $usage_help = "Usage: runw32.bat [any option valid for winn32.exe]";
  27. if ($ARGV[0] =~ /[-\/]([hH?]|(help))/i)
  28. {
  29. print $usage_help;
  30. exit;
  31. }
  32. if (rindex($0, '\\') >= 0)
  33. {
  34. $curdir = substr($0, 0, rindex($0, '\\'));
  35. }
  36. else
  37. {
  38. $curdir = `cd`;
  39. }
  40. chomp($curdir);
  41. $tempDir = $ENV{"TEMP"};
  42. $winnt32_src = $curdir;
  43. $winnt32_dst = "$tempDir\\winnt32";
  44. print "Please wait while files are being copied from $winnt32_src to $winnt32_dst...\n";
  45. `xcopy /q/s/d $winnt32_src\\*.* $winnt32_dst`;
  46. die "...error copying files from $winnt32_src: $!\n" if ($? != 0);
  47. $nt5_src=$curdir;
  48. if ($nt5_src =~ /(.+)winnt32$/i)
  49. {
  50. $nt5_src = $1;
  51. }
  52. $cmdline = "$winnt32_dst\\winnt32.exe /s:$nt5_src " . join(" ", @ARGV);
  53. print "$cmdline\n";
  54. `$cmdline`;
  55. #`rd /s/q $winnt32_dst`;
  56. #`deltree /y $winnt32_dst`;
  57. __END__
  58. :endofperl
  59. @echo off
  60. set THISFILE=%0
  61. if not exist %THISFILE% set THISFILE=%0.bat
  62. if "%TEMP%"=="" goto not_set_temp
  63. if "%TMP%"=="" goto not_set_temp
  64. set ARGS=
  65. :loop
  66. if .%1==. goto endloop
  67. set ARGS=%ARGS% %1
  68. shift
  69. goto loop
  70. :endloop
  71. set WINNT32_DIR=%TEMP%\winnt32
  72. if not exist %WINNT32_DIR% md %WINNT32_DIR%
  73. rem Need to find a good location for perl.exe
  74. set PERL=\\kumarp1\public\perl\perl.exe
  75. if not exist %PERL% set PERL=\\scratch\scratch\kumarp\perl\perl.exe
  76. if not exist %PERL% goto perl_not_found
  77. %PERL% %THISFILE% %ARGS%
  78. goto the_end
  79. :perl_not_found
  80. echo Cannot load %PERL%
  81. goto the_end
  82. :not_set_temp
  83. echo Environment variable TEMP or TMP is not set
  84. goto the_end
  85. :the_end