LoginSignup
83
60

More than 5 years have passed since last update.

管理者権限でメモ帳を開いてhostsを編集するコマンド

Posted at

Windowsでhostsを修正するのにいつも手間取ります。
メモ帳を管理者権限で開いて、[ファイル]->[開く]からhostsまで辿って・・・ってやってました。

Qiitaさんで調べたところ、管理者権限でメモ帳を開く方法は以下が参考になります。

いいですね!

さらに、コマンドで管理者権限で起動する方法を教えていただきましたので

それを参考にさせてもらって、管理者権限のメモ帳でhostsを開くコマンドがこちらになります。

powershell -NoProfile -ExecutionPolicy unrestricted -Command "start notepad C:\Windows\System32\drivers\etc\hosts -verb runas"

Win + r で「ファイル名を指定して実行」に上記コマンドを入れればメモ帳が開きます。

83
60
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
83
60