BASH   52

Windows-system-check.bat

Guest on 29th August 2021 07:07:55 AM

  1. @echo off
  2. color 0a
  3. mode con cols=90
  4. sc config winmgmt start= auto >nul 2<&1
  5. net start winmgmt 2>1nul
  6. setlocal ENABLEDELAYEDEXPANSION
  7.  
  8. echo 请输入编号并设置时区:
  9. :Main
  10. cls & set "Xz="
  11. echo 1、中国大陆
  12. echo 2、中国台湾
  13. echo 3、日本
  14. echo 4、德国
  15. echo 5、洛杉矶
  16. echo, & set /p Xz=请输入编号并回车:
  17. if "%Xz%"=="=="goto China Standard Time
  18. if "%Xz%"=="=="goto Taipei Standard Time
  19. if "%Xz%"=="3" goto Tokyo Standard Time
  20. if "%Xz%"=="4" goto W. Europe Standard Time
  21. if "%Xz%""="5" goto Pacific Standard Time
  22.  
  23. :err
  24. goto:Main
  25.  
  26. :China Standard Time
  27. start """tzutil /s "China Standard Time"
  28. pause
  29. goto time
  30. :Taipei Standard Time
  31. start """tzutil /s "Taipei Standard Time"
  32. pause
  33. goto time
  34. :W. Europe Standard Time
  35. start "util /s "Tokyo Standard Time"
  36. pause
  37. goto time
  38. :W. Europe Standard Time
  39. start "" tzutil /s "W. Europe Standard Time"
  40. pause
  41. goto time
  42. :Pacific Standard Time
  43. start "" tzutil /s "Pacific Standard Time"
  44. pause
  45. goto time
  46.  
  47. :time
  48. echo 开始同步时间:
  49. net start "windows time"
  50. w32tm /resync
  51. echo.
  52.  
  53. echo CPU:
  54. for /f "tokens=1,* delims==" %%a in ('wmic cpu get name^,ExtClock^,CpuStatus^,Description /value') do (
  55. set /a tee+=1
  56. if "!tee!" == "tokens=1,* delims=="%%b
  57. if "!tee!" == "6" echo 型号和频率 = %%b
  58. )
  59. set tee=0
  60. echo.
  61.  
  62. echo 内 存:
  63. for /f "tokens=1,* delims==" %%a in ('systeminfo^|find "物理内存"') do (
  64. echo %%a %%b
  65. )
  66. echo.
  67.  
  68. echo 硬 盘:
  69. >DiskCalc2.vbs echo DeviceID = Wscript.Arguments(0)
  70. >>DiskCalc2.vbs echo SizeAvail = Wscript.Arguments(1) / (1024 * 1024 * 1024)
  71. >>DiskCalc2.vbs echo SizeTotal = Wscript.Arguments(2) / (1024 * 1024 * 1024)
  72. >>DiskCalc2.vbs echo WSCript.Echo DeviceID ^& Chr(9) ^& Round(SizeTotal,1) ^& Chr(9)  ^& _
  73. >>DiskCalc2.vbs echo  "G"
  74.  
  75.  
  76. (for /f "tokens=1-3" %%a in ('wmic LogicalDisk where "DriveType='3'" get DeviceID ^, Size ^, FreeSpace ^| findstr ":"') do (
  77.     cscript //nologo DiskCalc2.vbs %%a %%b %%c
  78. ))
  79. del DiskCalc2.vbs
  80. echo.
  81. echo IP:
  82. for /f "tokens=16" %%i in ('ipconfig ^|find /i "ipv4"') do set ip=%%i
  83. echo ip=%ip%
  84. echo.
  85. echo 系统:
  86. for /f "tokens=1,* delims==" %%a in ('systeminfo^|find "OS 名称"') do (
  87. echo %%a  %%b
  88. )
  89. for /f "tokens=1,* delims==" %%a in ('systeminfo^|find "时区"') do (
  90. echo %%a  %%b
  91. )
  92. echo %date%
  93. echo %time%
  94. echo.
  95.  
  96. echo *******************************************************************
  97. echo * 请输入您要更改的远程桌面端口号,范围:1-65535,不能与其他端口冲突 *
  98. echo *******************************************************************
  99. echo.
  100. set /p port=请输入端口号:
  101. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v PortNumber /t reg_dword /d %port% /f
  102. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t reg_dword /d %port% /f
  103. echo.
  104. echo *******************************
  105. echo * 重新启动远程桌面*
  106. echo *******************************
  107. reg add "HKLM\SYST

Raw Paste


Login or Register to edit or fork this paste. It's free.