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.

60 lines
2.4 KiB

  1. REM ###############################################################
  2. REM # #
  3. REM # SetPaths #
  4. REM # #
  5. REM # Extracts the following paths into environment variables, #
  6. REM # allowing the scripts to run without hardcoded system path #
  7. REM # strings. This allows the scripts to run independently of #
  8. REM # system language. #
  9. REM # #
  10. REM # All Users:Startup COMMON_STARTUP #
  11. REM # All Users:Start Menu COMMON_START_MENU #
  12. REM # All Users:Start Menu\Programs COMMON_PROGRAMS #
  13. REM # Current User:Start Menu USER_START_MENU #
  14. REM # Current User:Startup USER_STARTUP #
  15. REM # Current User:Start Menu\Programs USER_PROGRAMS #
  16. REM # Current User:My Documents MY_DOCUMENTS #
  17. REM # Current User:Templates TEMPLATES #
  18. REM # Current User:Application Data APP_DATA
  19. REM # #
  20. REM ###############################################################
  21. REM ###############################################################
  22. REM # Use the GETPATHS option to set all of the environment variables
  23. REM ###############################################################
  24. "%systemroot%\Application Compatibility Scripts\ACRegL.exe" "%TEMP%\getpaths.cmd" COMMON_PATHS "HKLM\Software" "" GETPATHS
  25. If Not ErrorLevel 1 Goto Cont1
  26. Echo.
  27. Echo Unable to retrieve common or user paths.
  28. Echo.
  29. Goto Failure
  30. :Cont1
  31. Call "%TEMP%\getpaths.cmd"
  32. Del "%TEMP%\getpaths.cmd" >Nul: 2>&1
  33. REM If the values below are correct, execution has succeeded
  34. REM COMMON_START_MENU = %COMMON_START_MENU%
  35. REM COMMON_STARTUP = %COMMON_STARTUP%
  36. REM COMMON_PROGRAMS = %COMMON_PROGRAMS%
  37. REM USER_START_MENU = %USER_START_MENU%
  38. REM USER_STARTUP = %USER_STARTUP%
  39. REM USER_PROGRAMS = %USER_PROGRAMS%
  40. REM MY_DOCUMENTS = %MY_DOCUMENTS%
  41. REM TEMPLATES = %TEMPLATES%
  42. REM APP_DATA= %APP_DATA%
  43. Set _SetPaths=SUCCEED
  44. Goto Done
  45. :Failure
  46. Echo.
  47. Echo One or more queries for the common or user paths have failed!
  48. Echo Applications relying on this script may not install successfully.
  49. Echo Please resolve the problem and try again.
  50. Echo.
  51. Set _SetPaths=FAIL
  52. REM Pause
  53. Goto Done
  54. :Done