login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > Overige > VBScript > PC klaarmaken voor Terminal Services

PC klaarmaken voor Terminal Services

Auteur: Leviator - 06 februari 2007 - 10:15 - Gekeurd door: Abbas - Hits: 3039 - Aantal punten: 4.00 (1 stem)



Op mijn stage moest ik pc's hun opstarttijd zo veel mogelijk versnellen zodat ze zo snel mogelijk op een terminal service sessie konden ingelogd worden. Hiervoor heb ik met VisualBasicScript gewerkt, registersleutels aangepast, onnodige services gestopt, msconfig(boot.ini) aanpassen, en onnodige fonts verwijderen...
de meeste mensen weten wel hoe het werkt, je neemt een stukje code dat je wel kan gebruiken je plakt het in een kladblok (of eenders welke plain text editor) en je slaagt het op als een .vbs bestand, en dan uitvoeren maar.

Opgepast! LET OP MET WAT JE UITVOERT, niet alles zal ten goede komen van jou systeem, alleen de HOOGNODIGE services staan nog aan (pnp, netwerkservices) en ik heb niet overal uitleg bijgezet...

Mijn excuses voor de slechte opmaak en misschien té weinig commentaar,
mvg levi

Code:
  1. Set WSHShell = WScript.CreateObject("WScript.Shell")
  2.  
  3. 'Services configuration
  4. '4 is disable
  5. '3 is manual
  6. '2 is automatic
  7. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Browser\Start", 4, "REG_DWORD"
  8. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Messenger\Start", 4, "REG_DWORD"
  9. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Alerter\Start", 3, "REG_DWORD"
  10. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\ALG\Start", 3, "REG_DWORD"
  11. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\AppMgmt\Start", 4, "REG_DWORD"
  12. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\CiSvc\Start", 4, "REG_DWORD"
  13. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\ClipSrv\Start", 3, "REG_DWORD"
  14. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\COMSysApp\Start", 3, "REG_DWORD"
  15. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\CryptSvc\Start", 4, "REG_DWORD"
  16. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\dmadmin\Start", 4, "REG_DWORD"
  17. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\dmserver\Start", 4, "REG_DWORD"
  18. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Dnscache\Start", 2, "REG_DWORD"
  19. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\ERSvc\Start", 4, "REG_DWORD"
  20. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\Start", 2, "REG_DWORD"
  21. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\EventSystem\Start", 3, "REG_DWORD"
  22. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\FastUserSwitchingCompatibility\Start", 4, "REG_DWORD"
  23. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\helpsvc\Start", 4, "REG_DWORD"
  24. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\HidServ\Start", 4, "REG_DWORD"
  25. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\ImapiService\Start", 3, "REG_DWORD"
  26. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\Start", 2, "REG_DWORD"
  27. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\LmHosts\Start", 2, "REG_DWORD"
  28. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\McAfeeFramework\Start", 4, "REG_DWORD"
  29. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\mnmsrvc\Start", 3, "REG_DWORD"
  30. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\MSDTC\Start", 3, "REG_DWORD"
  31. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\MSIServer\Start", 3, "REG_DWORD"
  32. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\NetDDE\Start", 3, "REG_DWORD"
  33. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\NetDDEdsdm\Start", 3, "REG_DWORD"
  34. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Start", 2, "REG_DWORD"
  35. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Netman\Start", 3, "REG_DWORD"
  36. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Nla\Start", 3, "REG_DWORD"
  37. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\NtLmSsp\Start", 3, "REG_DWORD"
  38. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\NtmsSvc\Start", 3, "REG_DWORD"
  39. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\PlugPlay\Start", 2, "REG_DWORD"
  40. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\PolicyAgent\Start", 2, "REG_DWORD"
  41. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\ProtectedStorage\Start", 2, "REG_DWORD"
  42. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\RasAuto\Start", 4, "REG_DWORD"
  43. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\RDSessMgr\Start", 4, "REG_DWORD"
  44. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\RemoteAccess\Start", 4, "REG_DWORD"
  45. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\RemoteRegistry\Start", 2, "REG_DWORD"
  46. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\RpcLocator\Start", 3, "REG_DWORD"
  47. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\SamSs\Start", 2, "REG_DWORD"
  48. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\SCardDrv\Start", 3, "REG_DWORD"
  49. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\SCardSvr\Start", 3, "REG_DWORD"
  50. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Schedule\Start", 4, "REG_DWORD"
  51. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\seclogon\Start", 2, "REG_DWORD"
  52. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\SENS\Start", 2, "REG_DWORD"
  53. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Start", 3, "REG_DWORD"
  54. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\ShellHWDetection\Start", 4, "REG_DWORD"
  55. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Spooler\Start", 4, "REG_DWORD"
  56. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\srservice\Start", 2, "REG_DWORD"
  57. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\SSDPSRV\Start", 4, "REG_DWORD"
  58. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\stisvc\Start", 4, "REG_DWORD"
  59. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\SwPrv\Start", 3, "REG_DWORD"
  60. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\SysmonLog\Start", 3, "REG_DWORD"
  61. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\TapiSrv\Start", 4, "REG_DWORD"
  62. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\TermService\Start", 3, "REG_DWORD"
  63. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Themes\Start", 4, "REG_DWORD"
  64. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\TlntSvr\Start", 4, "REG_DWORD"
  65. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\TrkWks\Start", 4, "REG_DWORD"
  66. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\uploadmgr\Start", 2, "REG_DWORD"
  67. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\upnphost\Start", 3, "REG_DWORD"
  68. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\UPS\Start", 3, "REG_DWORD"
  69. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\VSS\Start", 3, "REG_DWORD"
  70. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Start", 2, "REG_DWORD"
  71. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Start", 4, "REG_DWORD"
  72. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\winmgmt\Start", 2, "REG_DWORD"
  73. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\WmdmPmSp\Start", 4, "REG_DWORD"
  74. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\WmiApSrv\Start", 3, "REG_DWORD"
  75. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\wuauserv\Start", 4, "REG_DWORD"
  76. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\WZCSVC\Start", 4, "REG_DWORD"
  77. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\BITS\Start", 4, "REG_DWORD"
  78. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Dhcp\Start", 2, "REG_DWORD"
  79. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\HidServ\Start", 2, "REG_DWORD"
  80. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\RSVP\Start", 3, "REG_DWORD"
  81. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\RasMan\Start", 4, "REG_DWORD"
  82. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\RpcSs\Start", 2, "REG_DWORD"
  83. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\AudioSrv\Start", 4, "REG_DWORD"
  84. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Wmi\Start", 3, "REG_DWORD"
  85. WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\lanmanworkstation\Start", 2, "REG_DWORD"
  86.  
  87. '----------------------- registerveranderingen -----------------------------------------------------------------------------
  88. 'enable boot defrag
  89. WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction\Enable", "Y", "REG_SZ"
  90. 'enable prefetcher
  91. WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters\EnablePrefetcher", 2, "REG_DWORD"
  92. 'Clear page file at shutdown
  93. WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\ClearPageFileAtShutdown", 0, "REG_DWORD"
  94. 'Wait to kill app timeout
  95. WSHShell.RegWrite "HKEY_USERS\.DEFAULT\Control Panel\Desktop\WaitToKillAppTimeout", 1000, "REG_SZ"
  96. 'auto end tasks
  97. WSHShell.RegWrite "HKEY_USERS\.DEFAULT\Control Panel\Desktop\AutoEndTasks", 1, "REG_SZ"
  98. 'Wait To Kill Service Timeout
  99. WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\WaitToKillServiceTimeout", 1000, "REG_SZ"
  100. '100ste lijn
  101.  
  102. '----------------------- FONTS -------------------------------------------------------------------------------------------
  103.  
  104. 'Ongebruikte Fonts Verwijderen
  105. Dim fso
  106. Set fso = CreateObject("Scripting.FileSystemObject")
  107.  
  108. const conFonts = "|verda|times|arial|trebu|tahom|micro|dosap|framd|lucon|moder|scrip|"
  109.  
  110. On error resume next
  111. Set objFolder = fso.GetFolder("C:\\Windows\Fonts")
  112. Set objFile_Col = objFolder.Files
  113. For Each objFile In objFile_Col
  114. If InStr(conFonts, "|" & Left(objFile.Name,5) & "|") = 0 Then
  115. fso.DeleteFile(objFile)
  116. End IF
  117. '================================================boot.ini ============================================
  118. ' execute noguiboot.bat
  119. WSHShell.run( "bootcfg /Delete /id 2" )
  120. WSHShell.run( "bootcfg /Timeout 3" )
  121. WSHShell.run( "bootcfg /addsw /id 1 /NG" )
  122. '====================== C drive defragmenatation========================================================
  123.  
  124. 'Forced C: defrag
  125. 'WSHShell.run( "defrag c:" )
  126.  
  127.  
  128.  
  129.  
  130. '----------------------- MSConfig -------------------------------------------------------------------------------------
  131. Set WSHShell = WScript.CreateObject("WScript.Shell")
  132. WshShell.RegDelete "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\"
  133. WshShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\IgfxTray","C:\\WINDOWS\\System32\\igfxtray.exe", "REG_SZ"
  134. WshShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\WinVNC","\""C:\\Program Files\\RealVNC\\WinVNC\\WinVNC.exe\"" -servicehelper", "REG_SZ"
  135. WScript.Quit()
  136. '-----------------------------------------------------------------------------------------------------------
Download code! Download code (.txt)

 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (2)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.041s