Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.comp.os.windows-10 > #47519
| From | Lionel Muller <Erhohterlowe@neomailbox.com> |
|---|---|
| Newsgroups | alt.comp.os.windows-10 |
| Subject | Re: What is the easiest way to edit the hosts file on Windows as admin? |
| Date | 2017-07-11 07:07 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <ok1tg9$1moi$1@gioia.aioe.org> (permalink) |
| References | <ok1sqo$1llk$1@gioia.aioe.org> |
For alt.comp.os.windows-10,alt.windows7.general Lionel Muller wrote:
> I will outline the methods that failed, all modeled on the methods we
> successfully used to open an admin prompt.
> 1. hotkey (failed)
> 2. shortcut (worked)
> 3. registry (failed)
> 4. batch file (failed)
For whatever reason, the batch file method failed.
Here is the batch file that works for opening a command prompt as admin.
===================
@ECHO OFF
REM Open a new shell "Run As Administrator"
REM Based on script by foxidrive on alt.msdos.batch
SETLOCAL ENABLEEXTENSIONS
IF NOT "%~1"=="" goto :START
SET MyFile=%TEMP%\Admin.vbs"
Echo Set UAC = CreateObject("Shell.Application") >"%MyFile%"
Echo UAC.ShellExecute "%~f0", "%cd%", "", "runas", 1 >>"%MyFile%"
Start "" /MIN "%MyFile%"
goto :EOF
:START
Cmd /k "CD /D "%*" & Echo Administrator: & color 4F"\
===================
I wasn't able to modify that batch file to edit the hosts file as admin.
===================
@ECHO OFF
SET MyFile=%TEMP%\C:\Windows\System32\Drivers\etc\hosts"
Echo Set UAC = CreateObject("Shell.Application") >"%MyFile%"
Echo UAC.ShellExecute "%~f0", "%cd%", "", "runas", 1 >>"%MyFile%"
Start "" /MIN "notepad.exe %MyFile%"
===================
What did I do wrong above?
The answer would be generally useful to everyone.
Do you know how to modify that batch file to open hosts as admin?
Back to alt.comp.os.windows-10 | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 06:56 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 07:07 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "Auric__" <not.my.real@email.address> - 2017-07-11 07:33 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lucifer Morningstar <not@for.mail> - 2017-07-11 17:44 +1000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 17:19 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Zeezicht <zeezicht_adelin.remove@telenet.remove.be> - 2017-07-11 11:23 +0200
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 17:19 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "s|b" <me@privacy.invalid> - 2017-07-11 13:49 +0200
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 17:19 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? slate_leeper <bycy-r0bj@spamex.com> - 2017-07-11 09:15 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Mike Tomlinson <mike@jasper.org.uk> - 2017-07-11 16:33 +0100
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 17:29 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "Mayayana" <mayayana@invalid.nospam> - 2017-07-11 09:43 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 17:36 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "Mayayana" <mayayana@invalid.nospam> - 2017-07-11 18:40 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 23:48 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-12 00:00 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 11:49 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "Auric__" <not.my.real@email.address> - 2017-07-12 07:32 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "Mayayana" <mayayana@invalid.nospam> - 2017-07-12 08:14 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 12:31 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-07-12 10:55 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Sam Hill <sam@example.com> - 2017-07-12 15:25 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-07-12 18:41 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? "Mayayana" <mayayana@invalid.nospam> - 2017-07-12 13:01 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-07-12 18:46 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 17:46 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Big Al <BigAl@invalid.com> - 2017-07-11 10:37 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 17:19 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 17:48 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-11 13:38 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 19:11 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 20:41 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-11 17:34 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 23:48 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 23:53 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-11 23:58 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 11:49 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 11:58 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-12 13:37 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 19:00 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-13 22:34 -0700
Re: What is the easiest way to edit the hosts file on Windows as admin? Paul <nospam@needed.invalid> - 2017-07-14 02:10 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-14 07:43 -0700
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-14 12:12 -0700
Re: What is the easiest way to edit the hosts file on Windows as admin? "Mayayana" <mayayana@invalid.nospam> - 2017-07-11 20:51 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 11:49 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-11 17:27 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 23:48 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-11 23:52 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 11:49 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 12:02 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? "Mayayana" <mayayana@invalid.nospam> - 2017-07-12 09:15 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 13:26 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 17:54 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 23:48 +0200
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 21:54 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 23:10 +0100
Re: What is the easiest way to edit the hosts file on Windows as admin? Ken Blake <Ken@invalid.news.com> - 2017-07-11 12:38 -0700
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 19:49 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-11 17:40 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 23:48 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Char Jackson <none@none.invalid> - 2017-07-11 23:01 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 11:49 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 20:41 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? jetjock <jetjock@example.com> - 2017-07-11 13:56 -0500
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 19:11 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 20:41 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-11 20:59 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Gralber@grelberville.org - 2017-07-11 20:06 -0400
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 11:49 +0000
Re: What is the easiest way to edit the hosts file on Windows as admin? Nomen Nescio <nobody@dizum.com> - 2017-07-12 20:04 +0200
Re: What is the easiest way to edit the hosts file on Windows as admin? Lionel Muller <Erhohterlowe@neomailbox.com> - 2017-07-12 19:00 +0000
csiph-web