0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

「管理者として実行」をコマンドで

Posted at

いちいち「アイコンを右クリック」->「管理者として実行」なんてしたくない。

UACが有効になっているWindows環境でコマンドプロンプトを使っていると、
管理者でログインしてるのに何かと「アクセスが拒否されました」と言われますね。
いちいち、コマンドプロンプトを「右クリック」->「管理者として実行」もめんどい。

そんな時の回避方法

prompt
REM ### 今起動しているコマンドプロンプトにて、powershellを起動。
powershell

プロンプトが変わったら以下のコマンドで、管理者モードのコマンドプロンプトが起動出来ます。

prompt
Start-Process cmd -verb runas 

ついでに、起動したコマンドプロンプトから管理者モードのエクスプローラを起動する時はこちら。

prompt
REM エクスプローラを起動したいフォルダに移動
cd c:¥temp¥i¥want¥to¥have¥privilege

REM エクスプローラを起動
start .

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?