Unix like sudo command on Windows
Common question: ‘Is there any ‘sudo’ command for Windows?’
An answer is here.
csudo in ConEmu
ConEmu package contains (started from build 121028) batch file
When checkbox ‘Add %ConEmuBaseDir% to %PATH%’ is checked (‘ComSpec’ settings page),
you may just type
csudo in non-elevated prompt in your shell.
Note You may also define an alias
csudo.cmd if you prefer simple
Just go to the Environment settings page.
Note Don’t change file contents to avoid your changes loss when new update of ConEmu arrives, set up options as described below instead.
csudo dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess
Let type in command prompt ‘csudo diskpart’
Get UAC confirmation on Vista or later
Here we are, diskpart started elevated in a split
Script and options
As you can see, batch contains two parameters, which you may redefine:
You may adjust them on the Environment settings page.
||VERT||Create new console in the split below current one|
|HORZ||Create new console in the split rightward|
|NO||Create new console in the new tab|
||YES||When started command terminates ConEmu will show ‘Press Enter or Esc to close console…’ confirmation in started console|
|NO||When started command terminates started console is closed automatically|
For example, if you want to start elevated command in new tab rather than in split just add the following line to your Environment:
Alias for cmd.exe
alias sudo=ConEmuC.exe -c $* -new_console:ac