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.

102 lines
5.0 KiB

  1. BEGIN {
  2. FS ="\t"
  3. dropdrive="\\\\elah\dist"
  4. dropdir="wab"
  5. printf "\t@ECHO OFF\n"
  6. printf "\tcls\n"
  7. printf "\techo.\n"
  8. printf "\techo *****************************************************************\n"
  9. printf "\techo * *\n"
  10. printf "\techo * *\n"
  11. printf "\techo * FOR ADMINISTRATIVE USE ONLY *\n"
  12. printf "\techo * INVOKE ONLY FROM WIN95 *\n"
  13. printf "\techo * *\n"
  14. printf "\techo * *\n"
  15. printf "\techo *****************************************************************\n"
  16. printf "\techo.\n\n"
  17. printf "\tif \"%%1\" == \"\" goto usage\n\n"
  18. printf "\tif \"%%HAMMER%%\" == \"HAMMER95\" goto testenvX\n"
  19. printf ":testenv\n"
  20. printf "\tif not \"%%OS%%\" == \"\" goto notwin95\n"
  21. printf ":testenvX\n\n"
  22. printf "\tif not exist %s\%s\bvt%%1 goto notfound\n\n", dropdrive, dropdir
  23. printf "\tif exist %s\%s\drop%%1 goto exists\n", dropdrive, dropdir
  24. printf "\tgoto existsX\n\n"
  25. printf ":exists\n"
  26. printf "\techo Well, %s\%s\drop%%1 already exists, are you sure that you want to \n", dropdrive, dropdir
  27. printf "\techo overwrite it? Please choose Y for Yes, or X to exit:\n"
  28. printf "\tCHOICE /N /C:YX\n"
  29. printf "\tIF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 GOTO MKDROP\n"
  30. printf "\tIF ERRORLEVEL 2 GOTO END\n"
  31. printf ":existsX\n\n"
  32. printf "\techo You have chosen to create the following drop:\n"
  33. printf "\techo.\n"
  34. printf "\techo \t\t\t%s\%s\drop%%1\n", dropdrive, dropdir
  35. printf "\techo.\n"
  36. printf "\techo If you would like to continue, press Y for Yes, or X to exit:\n"
  37. printf "\tCHOICE /N /C:YX\n"
  38. printf "\tIF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 GOTO MKDROP\n"
  39. printf "\tIF ERRORLEVEL 2 GOTO END"
  40. printf "\n\n:mkdrop\n"
  41. printf "\techo.\n"
  42. printf "\techo Making %s\%s\drop%%1\n", dropdrive, dropdir
  43. printf "\techo.\n"
  44. printf "\tif not exist %s\%s\drop%%1 md %s\%s\drop%%1\n", dropdrive, dropdir, dropdrive, dropdir
  45. printf "\tif not exist %s\%s\drop%%1\retail md %s\%s\drop%%1\retail\n", dropdrive, dropdir, dropdrive, dropdir
  46. printf "\tif not exist %s\%s\drop%%1\debug md %s\%s\drop%%1\debug\n\n", dropdrive, dropdir, dropdrive, dropdir
  47. }
  48. {
  49. if ( $2 != "" && $2 ~ /[.]/ && $4 == "Y" && $16 == "Y" )
  50. {
  51. printf "\tcopy %s\%s\bvt%%1\win95r\%s %s\%s\drop%%1\retail \n", dropdrive, dropdir, $2, dropdrive, dropdir
  52. printf "\tcopy %s\%s\bvt%%1\win95d\%s %s\%s\drop%%1\debug \n", dropdrive, dropdir, $2, dropdrive, dropdir
  53. }
  54. }
  55. END {
  56. printf "\tif exist %s\%s\bvt%%1\win95d\*.sym copy %s\%s\bvt%%1\win95d\*.sym %s\%s\drop%%1\debug \n", dropdrive, dropdir, dropdrive, dropdir, dropdrive, dropdir
  57. printf "\tif exist %s\%s\bvt%%1\win95r\*.sym copy %s\%s\bvt%%1\win95r\*.sym %s\%s\drop%%1\retail \n", dropdrive, dropdir, dropdrive, dropdir, dropdrive, dropdir
  58. printf "goto end\n"
  59. printf "\n:notwin95\n"
  60. printf "\tif exist 1 del 1\n"
  61. printf "\tif exist 2 del 2\n"
  62. printf "\techo.\n"
  63. printf "\techo ************You have an environment setting set for \"OS\"************\n"
  64. printf "\techo.\n"
  65. printf "\techo This setting instructs this program that you may be using Windows NT\n"
  66. printf "\techo as your OS.\n"
  67. printf "\techo.\n"
  68. printf "\techo Due to the limitations of the batch script version in Windows NT, you \n"
  69. printf "\techo must use Windows 95 for invocation of this program.\n"
  70. printf "\techo.\n"
  71. printf "\techo If you are using Windows 95, and this is an environment setting that\n"
  72. printf "\techo you need, set \"HAMMER=HAMMER95\" and retry this operation.\n"
  73. printf "\techo.\n"
  74. printf "\techo Don't forget to reset \"HAMMER=\" when this operation has completed.\n"
  75. printf "\tgoto end\n"
  76. printf "\n:notfound\n"
  77. printf "\t echo.\n"
  78. printf "\t echo SOURCE DIRECTORY NOT FOUND\n"
  79. printf "\t echo.\n"
  80. printf "\t echo The directory %s\%s\bvt%%1 was not found. Please make sure that\n", dropdrive, dropdir
  81. printf "\t echo you choose an existing directory.\n"
  82. printf "\t goto end\n"
  83. printf "\n:usage\n"
  84. printf "\techo.\n"
  85. printf "\techo IMPROPER SYNTAX\n"
  86. printf "\techo.\n"
  87. printf "\techo You must supply the directory name or number for your drop. Proper syntax\n"
  88. printf "\techo is as follows:\n"
  89. printf "\techo.\n"
  90. printf "\techo mkdrop 22\n"
  91. printf "\techo.\n"
  92. printf "\techo This will create a directory on %s named %s\drop22 and place\n", dropdrive, dropdir
  93. printf "\techo all of the retail and debug components into their respective directories.\n"
  94. printf "\n:end\n"
  95. printf "\techo.\n"
  96. printf "\tif exist 1 del 1\n"
  97. printf "\tif exist 2 del 2\n"
  98. printf "\techo Bye Bye\n"
  99. printf "\techo.\n"
  100. }