Skip to content

Instantly share code, notes, and snippets.

@a-chen
Last active July 20, 2017 02:56
Show Gist options
  • Save a-chen/7c6fcccae8ff08c963e6ba553fb1e3c3 to your computer and use it in GitHub Desktop.
Save a-chen/7c6fcccae8ff08c963e6ba553fb1e3c3 to your computer and use it in GitHub Desktop.
Install Cmder with Chocolatey and adds start from context and start menu
@echo off
goto check_permissions
:install
rem Installs Chocolatey package manager
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
rem Installs cmder
choco install cmder -y
cd /tools/cmder
rem Adds Cmder to right click context menu
cmder.exe /REGISTER ALL
start .
rem Below instructions for adding to Windows Start Menu
@echo Perform the following if you want to add Cmder to be searchable via search
@echo Right click Cmder.exe, click "Create shortcut"
@echo Move the shortcut to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs"
@echo And you're done!
@echo To get aliases working in Windows 10
@echo Open CMD window: Win+S and search for cmd(Command Prompt)
@echo Right Click on the window title and select Properties
@echo Check the use legacy option
@echo Optional aliases
@echo Add the below lines to /tools/Cmder/config/user-aliases.cmd after running installing Cmder
@echo ll=ls -lh --show-control-chars -F --color $*
@echo gs=git status
pause >nul
exit
:check_permissions
echo Administrative permissions required. Checking permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
echo Success: Administrative permissions confirmed.
) else (
@echo Failure: Please run as administrator.
pause >nul
)
goto install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment