Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I want to open notepad and edit hosts file, I have to start menu, find notepad shortcut, right click and run as administrator, then open hosts file in notepad in order to edit.

Is there any way to use command line to open notepad as administrator? Something like press win + R and enter notepad /admin. Is this possible?

share|improve this question

migrated from serverfault.com Jul 9 '11 at 7:36

This question came from our site for professional system and network administrators.

3 Answers 3

up vote 4 down vote accepted

You can do it a little bit faster with press Win, type in Search notepad and press Ctrl + Shift + Enter. Or you can keep open CommandPrompt window with higher privileges all the time and if some program needs to be opened with elevated privileges just start it from there with for instance: start notepad.

share|improve this answer

Take a look at runas /? in command prompt.

share|improve this answer
  • Press Win + R to open the run command line
  • Type - notepad c:\windows\system32\drivers\etc\hosts

I believe this should open your hosts file in notepad as an admin user. Does for me anyway.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.