Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: ClineCade Boot Script
- :: Completed 29 March 2017, Updated 5 June 2017
- :: Let's get rid of that Explorer UI
- taskkill /f /im explorer.exe >null
- :: We need Unicode Character Set and Batch Delayed Expansion to display the "ClineCade" logo
- chcp 65001 >nul
- setlocal enableextensions enabledelayedexpansion
- :splashScreen
- title [Clinecade]
- set lines=7
- set "line1= ██████╗██╗ ██╗███╗ ██╗███████╗ ██████╗ █████╗ ██████╗ ███████╗"
- set "line2= ██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝"
- set "line3= ██║ ██║ ██║██╔██╗ ██║█████╗ ██║ ███████║██║ ██║█████╗"
- set "line4= ██║ ██║ ██║██║╚██╗██║██╔══╝ ██║ ██╔══██║██║ ██║██╔══╝"
- set "line5= ╚██████╗███████╗██║██║ ╚████║███████╗╚██████╗██║ ██║██████╔╝███████╗"
- set "line6= ╚═════╝╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝╚═╝ ╚═╝╚═════╝ ╚══════╝"
- call :getquote
- cls
- echo.
- echo.
- for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"
- for /L %%a in (1,1,%lines%) do set num=0&set "line=!line%%a!"&call :type
- timeout /t 2 >nul
- goto :loadProcess
- :type
- call :color
- chgcolor 0%color%
- set "letter=!line:~%num%,1!"
- set "delay=%random%%random%%random%%random%%random%%random%%random%"
- set "delay=200"
- if not "%letter%"=="" set /p "=a%bs%%letter%" <nul
- for /L %%b in (1,1,%delay%) do rem
- if "%letter%"=="" echo.&goto :EOF
- set /a num+=1
- goto :type
- :color
- ::Pick a Random Number, assign it a value that represents a color
- set /a color=%random% %% 15-0
- if %color%==10 set color=A
- if %color%==11 set color=B
- if %color%==12 set color=C
- if %color%==13 set color=D
- if %color%==14 set color=E
- if %color%==15 set color=F
- if %color% LSS 1 goto :color
- goto :eof
- :getquote
- if not exist %userprofile%\quotes.txt (
- :: If our quotes.txt doesn't exist, let's just use a sample string.
- set "line7= Boot Script Sample Quote"
- goto :eof
- )
- :: Let's read the Contents of the quotes.txt Text File, and seperate each line into a seperate variable.
- for /f "delims=" %%x in (%userprofile%\quotes.txt) do set usrs=%%x
- set /a count=0
- :: Get the number of Lines in the text file.
- for /f "tokens=1delims=:" %%i in ('findstr /n "^" "%userprofile%\quotes.txt"') do set /a count=%%i
- :: Pick a Random line to use as our Quote.
- set /a rd=%random%%%count
- if %rd% equ 0 (set "skip=") else set "skip=skip=%rd%"
- set "found="
- :: Set the line7 Variable as our quote
- for /f "%skip%tokens=1*delims=:" %%i in ('findstr /n "^" "%userprofile%\quotes.txt"') do if not defined found set "found=%%i"&set "line7=%%j"
- :: We're done here! let's go back to our Type Animation
- goto :eof
- :loadProcess
- title [Clinecade] Waiting for Possible User Response
- echo Press any Key within 5 Seconds to Cancel the Launch Process...
- choice /c 1234567890qwertyuiopasdfghjklzxcvbnm /d 6 /t 0 /N
- if %errorlevel%==6 goto :prepareGUI
- :chooseClose
- chgcolor 07
- title [Clinecade] Choose an Exit Route...
- echo.
- echo Choose an Option within 10 seconds or Bootup will resume...
- echo.
- echo 1) Enter Sleep Mode
- echo.
- echo 2) Turn off Clinecade
- echo.
- echo 3) Reload Spotify UI
- echo.
- echo 4) Enter to Desktop
- echo.
- :: Press the 1, 2, 3, or 4 keys to execute one of the Above listed Actions.
- choice /c 12345 /d 5 /t 10 /N
- if %errorlevel%==1 goto :chooseSleep
- if %errorlevel%==2 goto :chooseShutdown
- if %errorlevel%==3 goto :chooseSPUI
- if %errorlevel%==4 goto :passCodeLock
- if %errorlevel%==5 goto :prepareGUI
- goto :chooseClose
- :chooseSleep
- title [Clinecade] Entering Sleep Mode...
- cls
- echo.
- echo Press any Key within 5 Seconds to Cancel the Sleep Process...
- :: Pressing any Key other than '6' will cancel our Process, and return to the Splash Screen
- choice /c 1234567890qwertyuiopasdfghjklzxcvbnm /d 6 /t 5 /N
- if not %errorlevel%==6 goto :splashScreen
- rundll32.exe powrprof.dll,SetSuspendState 0,1,0
- timeout /t 5
- goto :splashScreen
- :chooseSPUI
- title [Clinecade] Reloading Spotify UI...
- cls
- echo.
- echo Press any Key within 5 Seconds to Cancel the Reload Process...
- :: Pressing any Key other than '6' will cancel our Process, and return to the Splash Screen
- choice /c 1234567890qwertyuiopasdfghjklzxcvbnm /d 6 /t 5 /N
- if not %errorlevel%==6 goto :splashScreen
- taskkill /f /im nw.exe
- start %userprofile%\.emulators\spui\nw.exe %CD%
- timeout /t 6 && nircmd win min process nw.exe
- goto :splashScreen
- :chooseShutdown
- title [Clinecade] Shutting Down...
- echo Press any Key within 5 Seconds to Cancel the Shutdown Process...
- :: Pressing any Key other than '6' will cancel our Process, and return to the Splash Screen
- choice /c 1234567890qwertyuiopasdfghjklzxcvbnm /d 6 /t 5 /N
- if not %errorlevel%==6 goto :splashScreen
- shutdown -s
- pause
- :passCodeLock
- set attempts=0
- :attemptCode
- title [Clinecade] Enter Desktop Mode. [Attempts %attempts%/5]
- echo.
- echo WHAT'S THE PASSCODE???
- echo.
- :: Get a User Input to type the Password
- set /p "enterMe="
- :: If we entered nothing, ask again.
- if not defined enterMe goto :passCodeLock
- :: If we type the password wrong 5 times, go back to the Splash Screen
- if %attempts%==5 goto :splashScreen
- :: If our Password is right, let's open the Explorer UI
- if "%enterMe%"=="%cabPass%" goto :cancelProcess
- set /a attempts=%attempts%+1
- goto :attemptCode
- :cancelProcess
- echo.
- echo Process Cancelled!
- echo.
- timeout /t 3>nul
- ::Load Taskbar and Windows Explorer UI
- start explorer
- exit
- :makeHex
- call :color
- set var1=%color%
- call :color
- set var2=%color%
- call :color
- set var3=%color%
- call :color
- set var4=%color%
- call :color
- set var5=%color%
- call :color
- set var6=%color%
- set hex=%var1%%var2%%var3%%var4%%var5%%var6%
- goto :eof
- :prepareGUI
- title [Clinecade] Killing Extra Processes...
- :: Force close a bunch of extraneous processes.
- taskkill /f /im chrome.exe
- taskkill /f /im NvBackend.exe
- taskkill /f /im nvtray.exe
- taskkill /f /im nvxdsync.exe
- taskkill /f /im nvvsvc.exe
- taskkill /f /im vpncmgr_x64.exe
- taskkill /f /im vpnclient_x64.exee
- taskkill /f /im SearchIndexer.exe
- taskkill /f /im SearchFilterHost.exe
- taskkill /f /im SkypeHost.exe
- echo Processes Killed!
- echo.
- echo Now let's open JoyToKey, which will assist in Configuring the Controller..
- title [Clinecade] Starting JoyToKey...
- :: Let's see if JoyToKey is running
- tasklist /FI "IMAGENAME eq JoyToKey.exe" 2>NUL | find /I /N "JoyToKey.exe">NUL
- if not %errorlevel%==0 (
- :: If it's not running, let's open it up.
- cd %ProgramFiles%\JoyToKey
- start JoyToKey.exe
- :: Let's also make sure it's out of our way and Minimized.
- timeout /t 3 && nircmd win min process JoyToKey.exe
- echo Done!
- )
- echo.
- echo Now let's open the Spotify UI, which will assist in playing our Music..
- title [Clinecade] Starting Spotify UI...
- :: Check if Spotify UI is running...
- tasklist /FI "IMAGENAME eq spotifyui.exe" 2>NUL | find /I /N "spotifyui.exe">NUL
- if not %errorlevel%==0 (
- :: If it's not running, let's open it up.
- cd %USERPROFILE%\.emulators\spui
- start nw.exe %CD%
- :: Let's also make sure it's out of our way and Minimized.
- timeout /t 3 && nircmd win min process nw.exe
- echo Done!
- )
- echo.
- echo Now let's map the Spotify Button..
- title [Clinecade] Mapping Spotify Button...
- :: Check if our Spotify Button Map Program is running.
- tasklist /FI "IMAGENAME eq spbtn.exe" 2>NUL | find /I /N "spbtn.exe">NUL
- if not %errorlevel%==0 (
- :: If it's not running, let's open it up.
- cd %WINDIR%
- start spbtn.exe
- ::It runs in the background, nothing to Minimize.
- echo Done!
- )
- echo.
- echo Last but not least, let's launch the Frontend...
- echo.
- :: Wait wait, let's set the LED Lights to a random Color...
- call :makeHex
- call %WINDIR%\blink.cmd %hex%
- title [Clinecade] Front-end Active...
- ::Now we open the Front-end.
- cd %USERPROFILE%\.attract
- attract.exe
- :: Once the Front-end is closed, let's make sure the Boot Script is highighted.
- title [Clinecade]
- nircmd win activate stitle "[Clinecade]"
- goto :splashScreen
Add Comment
Please, Sign In to add comment