Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

89
61

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.

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

89
Posted at

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

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

いいですね!

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

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

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

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

89
61
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
opst
情報技術と社員力でお客様を成功に導く Make IT Your Success

Linked from these articles

Comments

No comments

Let's comment your feelings that are more than good

89
61

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address