Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem Original github gist - https://gist.github.com/TheJustLink/1f1707f971c81273339525558537c1e0
- SetLocal EnableDelayedExpansion
- set argument=%*
- set argument=!argument:"="!
- set argument=!argument:'=''!
- set firstSymbol=%argument:~0,1%
- set checkSymbol="
- if !firstSymbol! == !checkSymbol! (
- set argument=!argument:~1,-1!
- )
- powershell -Command "Start-Process cmd -ArgumentList(('/k cd {0}' -f (Get-Location).path), '& !argument!') -Verb RunAs"
- exit
Advertisement
Comments
-
- Original github gist - https://gist.github.com/TheJustLink/1f1707f971c81273339525558537c1e0
- Add sudo.cmd to PATH and use anywhere you want
- Examples:
- sudo
- sudo echo Hello World!
- sudo "echo 1 & echo 2"
Add Comment
Please, Sign In to add comment
Advertisement