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.

70 lines
2.1 KiB

  1. ::executed manually or automatically.
  2. ::BVTm shortcut is a link to the following command
  3. ::
  4. ::
  5. ::cmd file to startup menu
  6. @echo off
  7. SET AUTOLOGON=%SYSTEMDRIVE%\TOOLS\autologon.exe
  8. set SOURCE=%SYSTEMROOT%\system32\cscript.exe
  9. set PASSWORD=${BT_P}
  10. :: set $Password pass for BVTUSER
  11. :: (not implemented yet)
  12. set DEFAULTADMINISTRATORS=ADMINISTRATORS
  13. SET ADMINISTRATORS=
  14. :: set alternative "$Administrators" LANG specific group name
  15. :: (not implemented yet)
  16. IF /I "%ADMINISTRATORS%" =="" SET ADMINISTRATORS=%DEFAULTADMINISTRATORS%
  17. set BVTUSER=WINBLD
  18. set BVTDOMAIN=NTDEV
  19. set DEFAULTBVTCOMMAND=\\INTLNTSETUP\BVTSRC\runbvt.cmd %SYSTEMDRIVE%\BVT \\INTLNTSETUP\BVTRESULTS
  20. echo clean registry keys
  21. %SOURCE% %SYSTEMDRIVE%\TOOLS\fixlogon.wsf /c /d
  22. :: The autologon.exe must be used to store the user data for Autologon
  23. : step 1.
  24. @%AUTOLOGON% /delete /quiet > NUL
  25. echo add the link to %0 to startup menu
  26. %SOURCE% %SYSTEMDRIVE%\TOOLS\addlink.wsf /x:%SYSTEMDRIVE%\TOOLS\bvtm.cmd -y:AllUsersStartup /l:"BVT Test.lnk"
  27. IF /I "%userdomain%"=="%BVTDOMAIN%" (
  28. IF /I "%username%"=="%BVTUSER%" (
  29. goto :BVT
  30. goto :EOF
  31. )
  32. )
  33. echo set %BVTUSER% %ADMINISTRATORS% group member
  34. %SOURCE% %SYSTEMDRIVE%\TOOLS\add2grp.wsf /u:"winbld" /d /g:%ADMINISTRATORS%
  35. :: The autologon.exe must be used to store the user data for Autologon
  36. : step 1.
  37. @%AUTOLOGON% /delete /quiet > NUL
  38. : step 2.
  39. @echo %PASSWORD% | %AUTOLOGON% /set /username:%BVTDOMAIN%\%BVTUSER% /quiet > NUL
  40. echo verifying the %ADMINISTRATORS% group
  41. SET .\\=
  42. FOR /F %%_ in ('net localgroup %ADMINISTRATORS%') DO @(
  43. if /I \%%_\==\%BVTDOMAIN%\%BVTUSER%\ SET .\\=1)
  44. IF NOT DEFINED .\\ (
  45. echo cannot add the %BVTDOMAIN%\%BVTUSER% to %ADMINISTRATORS%
  46. echo giving up
  47. goto :EOF
  48. )
  49. echo set %BVTUSER% the default logon user via REGISTRY
  50. %SOURCE% %SYSTEMDRIVE%\TOOLS\fixlogon.wsf /u:%BVTUSER% /y:%BVTDOMAIN% /p:"%PASSWORD%" /d
  51. echo logging off
  52. :: %SYSTEMROOT%\system32\shutdown -l -t 0
  53. %SYSTEMROOT%\system32\logoff.exe
  54. goto :EOF
  55. :BVT
  56. title %userdomain% %username% executing BVT
  57. %DEFAULTBVTCOMMAND%
  58. goto :EOF