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.

154 lines
4.8 KiB

  1. @Echo Off
  2. Rem #########################################################################
  3. Rem
  4. Rem Verify that %RootDrive% has been configured and set it for this script.
  5. Rem
  6. Call "%SystemRoot%\Application Compatibility Scripts\ChkRoot.Cmd"
  7. If "%_CHKROOT%" == "FAIL" Goto Done
  8. Call "%SystemRoot%\Application Compatibility Scripts\SetPaths.Cmd"
  9. If "%_SETPATHS%" == "FAIL" Goto Done
  10. Rem #########################################################################
  11. Rem
  12. Rem copy files from the current user templates to the all users templates location
  13. Rem
  14. If Exist "%ALLUSERSPROFILE%\%TEMPLATES%\EXCEL8.XLS" Goto GetExlPath
  15. If Exist "%UserProfile%\%TEMPLATES%\EXCEL8.XLS" copy "%UserProfile%\%TEMPLATES%\EXCEL8.XLS" "%ALLUSERSPROFILE%\%TEMPLATES%\" /Y >Nul: 2>&1
  16. :GetExlPath
  17. Rem #########################################################################
  18. Rem
  19. Rem Get the installation location of Excel 97 from the registry. If
  20. Rem not found, assume Office isn't installed and display an error message.
  21. Rem
  22. ..\ACRegL %Temp%\O97.Cmd O97INST "HKLM\Software\Microsoft\Office\8.0" "BinDirPath" "STRIPCHAR\1"
  23. If Not ErrorLevel 1 Goto Cont0
  24. Echo.
  25. Echo Unable to retrieve Excel 97 installation location from the registry.
  26. Echo Verify that Excel 97 has already been installed and run this script
  27. Echo again.
  28. Echo.
  29. Pause
  30. Goto Done
  31. :Cont0
  32. Call %Temp%\O97.Cmd
  33. Del %Temp%\O97.Cmd >Nul: 2>&1
  34. Rem #########################################################################
  35. Rem
  36. Rem Remove Find Fast from the Startup menu for all users. Find Fast
  37. Rem is resource intensive and will impact system performance.
  38. Rem
  39. If Exist "%COMMON_STARTUP%\Microsoft Find Fast.lnk" Del "%COMMON_STARTUP%\Microsoft Find Fast.lnk" >Nul: 2>&1
  40. Rem #########################################################################
  41. Rem
  42. Rem Create the MsForms.Twd and RefEdit.Twd files, which are needed for
  43. Rem Powerpoint and Excel Add-ins (File/Save as HTML, etc). When either
  44. Rem program is run, they will replace the appropriate file with one
  45. Rem containing the necessary data.
  46. Rem
  47. If Exist %systemroot%\system32\MsForms.Twd Goto Cont2
  48. Copy Nul: %systemroot%\system32\MsForms.Twd >Nul: 2>&1
  49. Cacls %systemroot%\system32\MsForms.Twd /E /P "Authenticated Users":F >Nul: 2>&1
  50. :Cont2
  51. If Exist %systemroot%\system32\RefEdit.Twd Goto Cont3
  52. Copy Nul: %systemroot%\system32\RefEdit.Twd >Nul: 2>&1
  53. Cacls %systemroot%\system32\RefEdit.Twd /E /P "Authenticated Users":F >Nul: 2>&1
  54. :Cont3
  55. Rem #########################################################################
  56. Rem
  57. Rem Change Registry Keys to make paths point to user specific
  58. Rem directories.
  59. Rem
  60. Rem If not currently in Install Mode, change to Install Mode.
  61. Set __OrigMode=Install
  62. ChgUsr /query > Nul:
  63. if Not ErrorLevel 101 Goto Begin
  64. Set __OrigMode=Exec
  65. Change User /Install > Nul:
  66. :Begin
  67. Set __SharedTools=Shared Tools
  68. If Not "%PROCESSOR_ARCHITECTURE%"=="ALPHA" goto acsrCont1
  69. If Not Exist "%ProgramFiles(x86)%" goto acsrCont1
  70. Set __SharedTools=Shared Tools (x86)
  71. :acsrCont1
  72. ..\acsr "#ROOTDRIVE#" "%RootDrive%" Template\MsExcl97.Key MsExcl97.Tmp
  73. ..\acsr "#__SharedTools#" "%__SharedTools%" MsExcl97.Tmp MsExcl97.Tmp2
  74. ..\acsr "#INSTDIR#" "%O97INST%" MsExcl97.Tmp2 MsExcl97.Tmp3
  75. ..\acsr "#MY_DOCUMENTS#" "%MY_DOCUMENTS%" MsExcl97.Tmp3 MsExcl97.key
  76. Del MsExcl97.Tmp >Nul: 2>&1
  77. Del MsExcl97.Tmp2 >Nul: 2>&1
  78. Del MsExcl97.Tmp3 >Nul: 2>&1
  79. regini MsExcl97.key > Nul:
  80. Rem If original mode was execute, change back to Execute Mode.
  81. If "%__OrigMode%" == "Exec" Change User /Execute > Nul:
  82. Set __OrigMode=
  83. Rem #########################################################################
  84. Rem
  85. Rem Update Exl97Usr.Cmd to reflect actual installation directory and
  86. Rem add it to the UsrLogn2.Cmd script
  87. Rem
  88. ..\acsr "#INSTDIR#" "%O97INST%" ..\Logon\Template\Exl97Usr.Cmd ..\Logon\Exl97Usr.Cmd
  89. FindStr /I Exl97Usr %SystemRoot%\System32\UsrLogn2.Cmd >Nul: 2>&1
  90. If Not ErrorLevel 1 Goto Skip1
  91. Echo Call Exl97Usr.Cmd >> %SystemRoot%\System32\UsrLogn2.Cmd
  92. :Skip1
  93. Echo.
  94. Echo To insure proper operation of MS Excel 97, users who are
  95. Echo currently logged on must log off and log on again before
  96. Echo running any application.
  97. Echo.
  98. Echo Microsoft Excel 97 Multi-user Application Tuning Complete
  99. Rem
  100. Rem Get the permission compatibility mode from the registry.
  101. Rem If TSUserEnabled is 0 we need to warn user to change mode.
  102. Rem
  103. ..\ACRegL "%Temp%\tsuser.Cmd" TSUSERENABLED "HKLM\System\CurrentControlSet\Control\Terminal Server" "TSUserEnabled" ""
  104. If Exist "%Temp%\tsuser.Cmd" (
  105. Call "%Temp%\tsuser.Cmd"
  106. Del "%Temp%\tsuser.Cmd" >Nul: 2>&1
  107. )
  108. If NOT %TSUSERENABLED%==0 goto SkipWarning
  109. Echo.
  110. Echo IMPORTANT!
  111. Echo Terminal Server is currently running in Default Security mode.
  112. Echo This application requires the system to run in Relaxed Security mode
  113. Echo (permissions compatible with Terminal Server 4.0).
  114. Echo Use Terminal Services Configuration to view and change the Terminal
  115. Echo Server security mode.
  116. Echo.
  117. :SkipWarning
  118. Pause
  119. :Done