Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.75 KB | None | 0 0
  1. :::::::::::::::::::::::::::::::::::::::::::
  2. :: Automatically check & get admin rights::
  3. :::::::::::::::::::::::::::::::::::::::::::
  4. @echo off
  5. CLS
  6. ECHO.
  7. ECHO =============================
  8. ECHO Running Admin shell
  9. ECHO =============================
  10.  
  11. :checkPrivileges
  12. NET FILE 1>NUL 2>NUL
  13. if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
  14.  
  15. :getPrivileges
  16. if '%1'=='ELEV' (shift & goto gotPrivileges)
  17. ECHO.
  18. ECHO **************************************
  19. ECHO Invoking UAC for Privilege Escalation
  20. ECHO **************************************
  21.  
  22. setlocal DisableDelayedExpansion
  23. set "batchPath=%~0"
  24. setlocal EnableDelayedExpansion
  25. ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%OEgetPrivileges.vbs"
  26. ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%OEgetPrivileges.vbs"
  27. "%temp%OEgetPrivileges.vbs"
  28. exit /B
  29.  
  30. :gotPrivileges
  31. :::::::
  32. :START:
  33. :::::::
  34. setlocal & pushd .
  35. @echo off
  36.  
  37. :: Get ADMIN Privs
  38. :-------------------------------------
  39. mkdir "%windir%BatchGotAdmin"
  40. if '%errorlevel%' == '0' (
  41. rmdir "%windir%BatchGotAdmin" & goto gotAdmin
  42. ) else ( goto UACPrompt )
  43.  
  44. :UACPrompt
  45. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%getadmin.vbs"
  46. echo UAC.ShellExecute %0, "", "", "runas", 1 >> "%temp%getadmin.vbs"
  47.  
  48. "%temp%getadmin.vbs"
  49. exit /B
  50.  
  51. :gotAdmin
  52. if exist "%temp%getadmin.vbs" ( del "%temp%getadmin.vbs" )
  53. pushd "%CD%"
  54. CD /D "%~dp0"
  55. :-------------------------------------
  56. :: End Get ADMIN Privs
  57. @echo off
  58. Title Baseline Out of Box - Server Config
  59. Color F
  60. type RequiredFilesheader.txt
  61. pause
  62. cls
  63. echo 3
  64. ping localhost -n 2 > nul
  65. cls
  66. echo 3.
  67. ping localhost -n 2 > nul
  68. cls
  69. echo 3..
  70. ping localhost -n 2 > nul
  71. cls
  72. echo 3..2
  73. ping localhost -n 2 > nul
  74. cls
  75. echo 3..2.
  76. ping localhost -n 2 > nul
  77. cls
  78. echo 3..2..
  79. ping localhost -n 2 > nul
  80. cls
  81. echo 3..2..1
  82. ping localhost -n 2 > nul
  83. cls
  84. echo Liftoff
  85. ping localhost -n 2 > nul
  86. cls
  87. echo Creating Users - Admin - Adding New Users to
  88. echo Administrators and Remote Desktop User Groups
  89. ping localhost -n 4 > nul
  90. net user Admin /ADD
  91. net user /ADD
  92. net localgroup "Remote Desktop Users" Admin /add
  93. net localgroup "Remote Desktop Users" /add
  94. net localgroup "Administrators" Admin /add
  95. net localgroup "Administrators" /add
  96. pause
  97. cls
  98. type RequiredFilestext1.txt
  99. ping localhost -n 2 > nul
  100. cls
  101. type RequiredFilestext2.txt
  102. ping localhost -n 2 > nul
  103. cls
  104. type RequiredFilestext3.txt
  105. ping localhost -n 2 > nul
  106. pause
  107. netsh interface set interface name = "Local Area Connection" newname = "Outside"
  108. echo Local Area Connection has been changed to "Outside"
  109. echo Now, minion, configure it's IP
  110. echo.
  111. echo.
  112. echo Choose:
  113. echo [Static] Set Static IP
  114. echo [Dynamic] Set DHCP
  115. echo.
  116. :choice
  117. SET /P C=[Static,Dynamic]?
  118. for %%? in (Static) do if /I "%C%"=="%%?" goto Static
  119. for %%? in (Dynamic) do if /I "%C%"=="%%?" goto Dynamic
  120. goto choice
  121. :Static
  122. @echo off
  123. echo "Please enter Static IP Address Information"
  124. echo "Static IP Address:"
  125. set /p IP_Addr=
  126. echo.
  127. echo "Default Gateway:"
  128. set /p D_Gate=
  129. echo.
  130. echo "Subnet Mask:"
  131. set /p Sub_Mask=
  132. echo.
  133. echo "DNS being configured to Google Public"
  134. netsh interface ip set dns name="Outside" source=static addr=8.8.8.8
  135.  
  136. echo "Setting Static IP Information"
  137. netsh interface ip set address "Outside" static %IP_Addr% %Sub_Mask% %D_Gate% 1
  138. ping localhost -n 4 > nul
  139. Echo Your New IP Settings
  140. echo.
  141. netsh int ip show config
  142. pause
  143. cls
  144. goto interface2
  145.  
  146. :Dynamic
  147. @ECHO OFF
  148. ECHO Resetting IP Address and Subnet Mask For DHCP
  149. netsh int ip set address name = "Outside" source = dhcp
  150.  
  151. ipconfig /renew
  152.  
  153. ECHO Here are the new settings for %computername%:
  154. netsh int ip show config
  155.  
  156. pause
  157. cls
  158. goto interface2
  159. :interface2
  160.  
  161. netsh interface set interface name = "Local Area Connection 2" newname = "Storage"
  162. echo Local Area Connection 2 has been changed to "Storage"
  163. echo Now, minion, configure it's IP....again
  164. echo.
  165. echo.
  166. echo Choose:
  167. echo [Static] Set Static IP
  168. echo [Dynamic] Set DHCP
  169. echo.
  170. :choice
  171. SET /P C=[Static,Dynamic]?
  172. for %%? in (Static) do if /I "%C%"=="%%?" goto Static
  173. for %%? in (Dynamic) do if /I "%C%"=="%%?" goto Dynamic
  174. goto choice
  175. :Static
  176. @echo off
  177. echo "Please enter Static IP Address Information"
  178. echo "Static IP Address:"
  179. set /p IP_Addr=
  180. echo.
  181. echo "Default Gateway:"
  182. set /p D_Gate=
  183. echo.
  184. echo "Subnet Mask:"
  185. set /p Sub_Mask=
  186.  
  187. echo "Setting Static IP Information"
  188. netsh interface ip set address "Storage" static %IP_Addr% %Sub_Mask% %D_Gate% 1
  189. ping localhost -n 4 > nul
  190. cls
  191. Echo Your New IP Settings
  192. echo.
  193. netsh int ip show config
  194. pause
  195. goto next
  196.  
  197. :Dynamic
  198. @ECHO OFF
  199. ECHO Resetting IP Address and Subnet Mask For DHCP
  200. netsh int ip set address name = "LAN" source = dhcp
  201.  
  202. ipconfig /renew
  203.  
  204. Echo Your New IP Settings
  205. echo.
  206. netsh int ip show config
  207. pause
  208. goto next
  209.  
  210. :next
  211. cls
  212. echo Disabling Firewall
  213. netsh advfirewall set allprofiles state off
  214. msg * "WARNING - All Firewall Profiles Have Been Disabled"
  215. ping localhost -n 4 > nul
  216. pause
  217. goto changename
  218.  
  219. :changename
  220. cls
  221. @echo off
  222. SET /P PCNAME=Please enter desired computer name:
  223. REG ADD HKLMSYSTEMCurrentControlSetControlComputerNameComputerName /v ComputerName /t REG_SZ /d %PCNAME% /f
  224. ping localhost -n 4 > nul
  225. pause
  226. goto enableremote
  227.  
  228. :enableremote
  229. cls
  230. Echo Enabling Remote Desktop
  231. reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
  232. ping localhost -n 4 > nul
  233. pause
  234. goto logmein
  235.  
  236. :logmein
  237. cls
  238. echo Installing LogMeIn - Please Follow Installer
  239. msiexec /i RequiredFilesLogMeIn.msi
  240. echo LogMeIn Installer Has Finished
  241. pause
  242. goto genetec
  243.  
  244. :genetec
  245. cls
  246. echo Installing Genetec Security Center - Please Follow Installer
  247. start /wait RequiredFilesGenetecFullsetup.exe
  248. echo Genetec Installer Has Finished
  249. pause
  250. goto finished
  251.  
  252. :finished
  253. cls
  254. echo Out of Box Configuration Complete
  255. msg * "Out of Box Configuration Complete"
  256. ping localhost -n 2 > nul
  257. cls
  258. type RequiredFilesend.txt
  259. ping localhost -n 2 > nul
  260. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement