Clinecade

GUI | Start-up

Jun 2nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 8.47 KB | None | 0 0
  1. @echo off
  2.  
  3. :: ClineCade Boot Script
  4.  
  5. :: Completed 29 March 2017, Updated 5 June 2017
  6.  
  7. :: Let's get rid of that Explorer UI
  8. taskkill /f /im explorer.exe >null
  9.  
  10. :: We need Unicode Character Set and Batch Delayed Expansion to display the "ClineCade" logo
  11. chcp 65001 >nul
  12. setlocal enableextensions enabledelayedexpansion
  13.  
  14. :splashScreen
  15. title [Clinecade]
  16. set lines=7
  17.  
  18.  
  19. set "line1=   ██████╗██╗     ██╗███╗   ██╗███████╗ ██████╗ █████╗ ██████╗ ███████╗"
  20. set "line2=  ██╔════╝██║     ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝"
  21. set "line3=  ██║     ██║     ██║██╔██╗ ██║█████╗  ██║     ███████║██║  ██║█████╗"
  22. set "line4=  ██║     ██║     ██║██║╚██╗██║██╔══╝  ██║     ██╔══██║██║  ██║██╔══╝"
  23. set "line5=  ╚██████╗███████╗██║██║ ╚████║███████╗╚██████╗██║  ██║██████╔╝███████╗"
  24. set "line6=   ╚═════╝╚══════╝╚═╝╚═╝  ╚═══╝╚══════╝ ╚═════╝╚═╝  ╚═╝╚═════╝ ╚══════╝"
  25. call :getquote
  26. cls
  27. echo.
  28. echo.
  29. for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"
  30. for /L %%a in (1,1,%lines%) do set num=0&set "line=!line%%a!"&call :type
  31. timeout /t 2 >nul
  32. goto :loadProcess
  33.  
  34. :type
  35. call :color
  36. chgcolor 0%color%
  37. set "letter=!line:~%num%,1!"
  38. set "delay=%random%%random%%random%%random%%random%%random%%random%"
  39. set "delay=200"
  40. if not "%letter%"=="" set /p "=a%bs%%letter%" <nul
  41. for /L %%b in (1,1,%delay%) do rem
  42. if "%letter%"=="" echo.&goto :EOF
  43. set /a num+=1
  44. goto :type
  45.  
  46. :color
  47. ::Pick a Random Number, assign it a value that represents a color
  48. set /a color=%random% %% 15-0
  49. if %color%==10 set color=A
  50. if %color%==11 set color=B
  51. if %color%==12 set color=C
  52. if %color%==13 set color=D
  53. if %color%==14 set color=E
  54. if %color%==15 set color=F
  55. if %color% LSS 1 goto :color
  56. goto :eof
  57.  
  58. :getquote
  59. if not exist %userprofile%\quotes.txt (
  60. :: If our quotes.txt doesn't exist, let's just use a sample string.
  61. set "line7=                      Boot Script Sample Quote"
  62. goto :eof
  63. )
  64.  
  65. :: Let's read the Contents of the quotes.txt Text File, and seperate each line into a seperate variable.
  66. for /f "delims=" %%x in (%userprofile%\quotes.txt) do set usrs=%%x
  67. set /a count=0
  68. :: Get the number of Lines in the text file.
  69. for /f "tokens=1delims=:" %%i in ('findstr /n "^" "%userprofile%\quotes.txt"') do set /a count=%%i
  70. :: Pick a Random line to use as our Quote.
  71. set /a rd=%random%%%count
  72. if %rd% equ 0 (set "skip=") else set "skip=skip=%rd%"
  73. set "found="
  74. :: Set the line7 Variable as our quote
  75. for /f "%skip%tokens=1*delims=:" %%i in ('findstr /n "^" "%userprofile%\quotes.txt"') do if not defined found set "found=%%i"&set "line7=%%j"
  76. :: We're done here! let's go back to our Type Animation
  77. goto :eof
  78.  
  79.  
  80. :loadProcess
  81. title [Clinecade] Waiting for Possible User Response
  82. echo Press any Key within 5 Seconds to Cancel the Launch Process...
  83. choice /c 1234567890qwertyuiopasdfghjklzxcvbnm /d 6 /t 0 /N
  84. if %errorlevel%==6 goto :prepareGUI
  85.  
  86. :chooseClose
  87. chgcolor 07
  88. title [Clinecade] Choose an Exit Route...
  89. echo.
  90. echo Choose an Option within 10 seconds or Bootup will resume...
  91. echo.
  92. echo 1) Enter Sleep Mode
  93. echo.
  94. echo 2) Turn off Clinecade
  95. echo.
  96. echo 3) Reload Spotify UI
  97. echo.
  98. echo 4) Enter to Desktop
  99. echo.
  100. :: Press the 1, 2, 3, or 4 keys to execute one of the Above listed Actions.
  101. choice /c 12345 /d 5 /t 10 /N
  102. if %errorlevel%==1 goto :chooseSleep
  103. if %errorlevel%==2 goto :chooseShutdown
  104. if %errorlevel%==3 goto :chooseSPUI
  105. if %errorlevel%==4 goto :passCodeLock
  106. if %errorlevel%==5 goto :prepareGUI
  107. goto :chooseClose
  108.  
  109. :chooseSleep
  110. title [Clinecade] Entering Sleep Mode...
  111. cls
  112. echo.
  113. echo Press any Key within 5 Seconds to Cancel the Sleep Process...
  114. :: Pressing any Key other than '6' will cancel our Process, and return to the Splash Screen
  115. choice /c 1234567890qwertyuiopasdfghjklzxcvbnm /d 6 /t 5 /N
  116. if not %errorlevel%==6 goto :splashScreen
  117. rundll32.exe powrprof.dll,SetSuspendState 0,1,0
  118. timeout /t 5
  119. goto :splashScreen
  120.  
  121. :chooseSPUI
  122. title [Clinecade] Reloading Spotify UI...
  123. cls
  124. echo.
  125. echo Press any Key within 5 Seconds to Cancel the Reload Process...
  126. :: Pressing any Key other than '6' will cancel our Process, and return to the Splash Screen
  127. choice /c 1234567890qwertyuiopasdfghjklzxcvbnm /d 6 /t 5 /N
  128. if not %errorlevel%==6 goto :splashScreen
  129. taskkill /f /im nw.exe
  130. start %userprofile%\.emulators\spui\nw.exe %CD%
  131. timeout /t 6 && nircmd win min process nw.exe
  132. goto :splashScreen
  133.  
  134.  
  135.  
  136. :chooseShutdown
  137. title [Clinecade] Shutting Down...
  138. echo Press any Key within 5 Seconds to Cancel the Shutdown Process...
  139. :: Pressing any Key other than '6' will cancel our Process, and return to the Splash Screen
  140. choice /c 1234567890qwertyuiopasdfghjklzxcvbnm /d 6 /t 5 /N
  141. if not %errorlevel%==6 goto :splashScreen
  142. shutdown -s
  143. pause
  144.  
  145.  
  146.  
  147. :passCodeLock
  148. set attempts=0
  149. :attemptCode
  150. title [Clinecade] Enter Desktop Mode. [Attempts %attempts%/5]
  151. echo.
  152. echo WHAT'S THE PASSCODE???
  153. echo.
  154. :: Get a User Input to type the Password
  155. set /p "enterMe="
  156. :: If we entered nothing, ask again.
  157. if not defined enterMe goto :passCodeLock
  158. :: If we type the password wrong 5 times, go back to the Splash Screen
  159. if %attempts%==5 goto :splashScreen
  160. :: If our Password is right, let's open the Explorer UI
  161. if "%enterMe%"=="%cabPass%" goto :cancelProcess
  162. set /a attempts=%attempts%+1
  163. goto :attemptCode
  164.  
  165. :cancelProcess
  166. echo.
  167. echo Process Cancelled!
  168. echo.
  169. timeout /t 3>nul
  170. ::Load Taskbar and Windows Explorer UI
  171. start explorer
  172. exit
  173.  
  174. :makeHex
  175. call :color
  176. set var1=%color%
  177. call :color
  178. set var2=%color%
  179. call :color
  180. set var3=%color%
  181. call :color
  182. set var4=%color%
  183. call :color
  184. set var5=%color%
  185. call :color
  186. set var6=%color%
  187. set hex=%var1%%var2%%var3%%var4%%var5%%var6%
  188. goto :eof
  189.  
  190.  
  191. :prepareGUI
  192. title [Clinecade] Killing Extra Processes...
  193. :: Force close a bunch of extraneous processes.
  194. taskkill /f /im chrome.exe
  195. taskkill /f /im NvBackend.exe
  196. taskkill /f /im nvtray.exe
  197. taskkill /f /im nvxdsync.exe
  198. taskkill /f /im nvvsvc.exe
  199. taskkill /f /im vpncmgr_x64.exe
  200. taskkill /f /im vpnclient_x64.exee
  201. taskkill /f /im SearchIndexer.exe
  202. taskkill /f /im SearchFilterHost.exe
  203. taskkill /f /im SkypeHost.exe
  204. echo Processes Killed!
  205. echo.
  206. echo Now let's open JoyToKey, which will assist in Configuring the Controller..
  207. title [Clinecade] Starting JoyToKey...
  208.  
  209. :: Let's see if JoyToKey is running
  210. tasklist /FI "IMAGENAME eq JoyToKey.exe" 2>NUL | find /I /N "JoyToKey.exe">NUL
  211. if not %errorlevel%==0 (
  212.  
  213. :: If it's not running, let's open it up.
  214.  
  215. cd %ProgramFiles%\JoyToKey
  216. start JoyToKey.exe
  217.  
  218. :: Let's also make sure it's out of our way and Minimized.
  219. timeout /t 3 && nircmd win min process JoyToKey.exe
  220. echo Done!
  221. )
  222. echo.
  223. echo Now let's open the Spotify UI, which will assist in playing our Music..
  224. title [Clinecade] Starting Spotify UI...
  225.  
  226. :: Check if Spotify UI is running...
  227. tasklist /FI "IMAGENAME eq spotifyui.exe" 2>NUL | find /I /N "spotifyui.exe">NUL
  228. if not %errorlevel%==0 (
  229.  
  230. :: If it's not running, let's open it up.
  231.  
  232. cd %USERPROFILE%\.emulators\spui
  233. start nw.exe %CD%
  234.  
  235. :: Let's also make sure it's out of our way and Minimized.
  236. timeout /t 3 && nircmd win min process nw.exe
  237. echo Done!
  238. )
  239. echo.
  240. echo Now let's map the Spotify Button..
  241. title [Clinecade] Mapping Spotify Button...
  242.  
  243. :: Check if our Spotify Button Map Program is running.
  244. tasklist /FI "IMAGENAME eq spbtn.exe" 2>NUL | find /I /N "spbtn.exe">NUL
  245. if not %errorlevel%==0 (
  246.  
  247. :: If it's not running, let's open it up.
  248.  
  249. cd %WINDIR%
  250. start spbtn.exe
  251.  
  252. ::It runs in the background, nothing to Minimize.
  253. echo Done!
  254. )
  255. echo.
  256. echo Last but not least, let's launch the Frontend...
  257. echo.
  258. :: Wait wait, let's set the LED Lights to a random Color...
  259. call :makeHex
  260. call %WINDIR%\blink.cmd %hex%
  261. title [Clinecade] Front-end Active...
  262.  
  263. ::Now we open the Front-end.
  264. cd %USERPROFILE%\.attract
  265. attract.exe
  266. :: Once the Front-end is closed, let's make sure the Boot Script is highighted.
  267. title [Clinecade]
  268. nircmd win activate stitle "[Clinecade]"
  269. goto :splashScreen
Add Comment
Please, Sign In to add comment