Skip to content

Instantly share code, notes, and snippets.

@Rodrigo54
Last active November 6, 2019 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rodrigo54/0dfa7cba9b965e7bf63b1ea4bb45efaf to your computer and use it in GitHub Desktop.
Save Rodrigo54/0dfa7cba9b965e7bf63b1ea4bb45efaf to your computer and use it in GitHub Desktop.
:: Thanks to blak3r for creating the part to check for admin rights
:: https://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights
echo OFF
NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
ECHO Administrator PRIVILEGES Detected!
) ELSE (
echo ######## ######## ######## ####### ########
echo ## ## ## ## ## ## ## ## ##
echo ## ## ## ## ## ## ## ## ##
echo ###### ######## ######## ## ## ########
echo ## ## ## ## ## ## ## ## ##
echo ## ## ## ## ## ## ## ## ##
echo ######## ## ## ## ## ####### ## ##
echo.
echo.
echo ####### ERROR: ADMINISTRATOR PRIVILEGES REQUIRED #########
echo This script must be run as an administrator to work properly!
echo If you're seeing this after opening the script, then right click and select "Run as administrator".
echo ##########################################################
echo.
PAUSE
EXIT /B 1
)
@echo ON
xcopy "%~dp0/terminal.ico" "%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\" /b /v /y /q
@echo off
reg.exe add "HKEY_CLASSES_ROOT\Directory\Background\shell\wt" /f /ve /d "Open Windows Terminal here"
reg.exe add "HKEY_CLASSES_ROOT\Directory\Background\shell\wt" /f /v "Icon" /t REG_EXPAND_SZ /d "\"%%LOCALAPPDATA%%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\terminal.ico\""
reg.exe add "HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command" /f /ve /t REG_EXPAND_SZ /d "\"%%LOCALAPPDATA%%\Microsoft\WindowsApps\wt.exe\""
pause
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{99c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles": [
{
// Make changes here to the powershell.exe profile
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
"guid": "{99c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Cmder",
"commandline": "cmd.exe /k c:\\cmder\\vendor\\init.bat",
"startingDirectory" : ".",
"hidden": false,
"colorScheme": "Monokai",
"fontFace": "Fira Code",
"fontSize": 10,
"icon": "c:\\cmder\\icons\\cmder.ico"
},
{
// Make changes here to the cmd.exe profile
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"hidden": false
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}
],
// Add custom color schemes to this array
"schemes": [
{
"name": "Monokai Night",
"background": "#1f1f1f",
"foreground": "#f8f8f8",
"black": "#1f1f1f",
"blue": "#6699df",
"cyan": "#e69f66",
"green": "#a6e22e",
"purple": "#ae81ff",
"red": "#f92672",
"white": "#f8f8f2",
"yellow": "#e6db74",
"brightBlack": "#75715e",
"brightBlue": "#66d9ef",
"brightCyan": "#e69f66",
"brightGreen": "#a6e22e",
"brightPurple": "#ae81ff",
"brightRed": "#f92672",
"brightWhite": "#f8f8f2",
"brightYellow": "#e6db74"
},
{
"name": "Monokai",
"background": "#1f1f1f",
"foreground": "#f8f8f8",
"black": "#272822",
"blue": "#F8F8F0",
"cyan": "#E6DB74",
"green": "#85BB1A",
"purple": "#AE81FF",
"red": "#FD971F",
"white": "#F8F8F2",
"yellow": "#A5A290",
"brightBlack": "#75715e",
"brightBlue": "#66D9EF",
"brightCyan": "#66D9EF",
"brightGreen": "#A6E22E",
"brightPurple": "#F92672",
"brightRed": "#CB064D",
"brightWhite": "#F8F8F0",
"brightYellow": "#FD971F"
}
],
// Add any keybinding overrides to this array.
// To unbind a default keybinding, set the command to "unbound"
"keybindings": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment