home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 February / CMCD0205.ISO / Software / Freeware / Utilitare / pebuild / plugin / bartpe / msserver.cmd < prev    next >
OS/2 REXX Batch file  |  2004-12-06  |  1KB  |  48 lines

  1. @echo off
  2. setlocal
  3. echo BARTPE: Check if network client is installed
  4. bartpe.exe -c c -q ms_msclient
  5. if errorlevel 1 (
  6.     echo.
  7.     echo BARTPE: MS Client is not installed!
  8.     echo BARTPE: Please load client network support before this script!
  9.     goto _err)
  10. echo BARTPE: Check if server service is installed
  11. bartpe.exe -c s -q ms_server
  12. if not errorlevel 1 (
  13.     echo.
  14.     echo BARTPE: MS Server service is already installed!
  15.     echo BARTPE: It can only be loaded once...
  16.     goto _err)
  17. echo BARTPE: Installing Microsoft Server
  18. bartpe.exe -c s -i ms_server
  19. if errorlevel 1 goto _err
  20. echo BARTPE: Starting SERVER service
  21. net start server
  22. if errorlevel 1 goto _err
  23. set _pass=%random%
  24. echo BARTPE: Setting Administrator password to %_pass%
  25. net user Administrator %_pass%
  26. if errorlevel 1 goto _err
  27. echo BARTPE: Creating drive shares
  28. for %%i in (b c d e f g h i j k l m n o p q r s t u v w x y z) do (
  29.     if exist %%i:\nul net share drive-%%i=%%i:\
  30. )
  31. if not exist %windir%\system32\hostname.exe goto _nohost
  32. echo Getting hostname...
  33. hostname.exe
  34. :_nohost
  35. echo.
  36. echo *** SECURITY NOTE! ***
  37. echo To access the shares on this system you must logon as administrator 
  38. echo with the password %_pass% !!!
  39. echo *** SECURITY NOTE! ***
  40. goto _end
  41. :_err
  42. echo.
  43. echo BARTPE: There was an error, script aborted!!!
  44. rem set errorlevel to 1 by (mis)using color
  45. color 00 
  46. :_end
  47. endlocal
  48.