Solved

why edit not working

Posted on 2013-06-24
14
464 Views
Last Modified: 2013-06-29
Directory of C:\Windows\System32\drivers\etc

07/13/2009  08:20 PM    <DIR>          .
07/13/2009  08:20 PM    <DIR>          ..
06/24/2013  05:32 PM               826 hosts
06/10/2009  02:00 PM             3,683 lmhosts.sam
06/10/2009  02:00 PM               407 networks
06/10/2009  02:00 PM             1,358 protocol
06/10/2009  02:00 PM            17,463 services
               5 File(s)         23,737 bytes
               2 Dir(s)  11,307,667,456 bytes free

C:\Windows\System32\drivers\etc>edit hosts.txt
'edit' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\System32\drivers\etc>edit hosts
'edit' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\System32\drivers\etc>edit hosts
'edit' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\System32\drivers\etc>
0
Comment
Question by:walkerdba
  • 4
  • 3
  • 3
  • +2
14 Comments
 
LVL 53

Expert Comment

by:Bill Prew
ID: 39273561
Check for the following file, sounds like it is missing.

What version of Windows?

You're probably better off using "notepad" instead of "edit" anyway, easier to use.

~bp
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 39273572
I don't think Edit has been around since Microsoft dropped QBasic. (The QBasic Editor was the same, I believe).
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 39273578
I have it on Windows 7.

~bp
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 39273587
What is it?

(It's not on Win8 x64).

Actually, that might be it - when I ran it, I reverted to short file names... perhaps Edit is 16bit and thus won't be on a 64 bit system.  Yep, I think that's it - EDIT runs in NTVDM, which is not on 64 bit Windows.

But it is on XP.

Wow... Talk about a blast from the past.
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 39273596
Though admittedly wikipedia:
Edit version 2.0 appeared with Windows 95, and appears in Windows 2000 and later. As it is still a 16-bit DOS program, it is not included in any 64-bit version of Windows, nor will it directly work on one. This version of Edit will run on DOS 3.30 and higher.
http://en.wikipedia.org/wiki/MS-DOS_Editor
0
 
LVL 12

Expert Comment

by:ktaczala
ID: 39275239
To modify the host file you "MUST" run notepad or any other text editor in "Run As Administrator" Mode.  So type notepad in the start bar, right click on notepad, Run As Administrator, then browse to the host file (C:\Windows\System32\drivers\etc).  Don't forget to change the show .txt to All files in the notepad open dialog.  You can view the host file without "Run as Administrator" but you can't save it without "Run As Administrator".
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 39275251
To modify the host file you "MUST" run notepad or any other text editor in "Run As Administrator" Mode.  So type notepad in the start bar, right click on notepad, Run As Administrator, then browse to the host file (C:\Windows\System32\drivers\etc).  Don't forget to change the show .txt to All files in the notepad open dialog.  You can view the host file without "Run as Administrator" but you can't save it without "Run As Administrator".
That's a great and valid point, but only if the poster is using a version of Windows newer than XP.  If XP or older then that wasn't required, and I don't think I've seen yet what the specific version of Windows involved is.

~bp
0
 
LVL 12

Expert Comment

by:ktaczala
ID: 39275385
good point.
0
 
LVL 12

Expert Comment

by:ktaczala
ID: 39275406
If it is windows xp or earlier then the issue is probably a path issue in the windows environment.  type path and see what's there.  I believe the dos commands were located in "C:\windows\command\"
0
 
LVL 44

Accepted Solution

by:
Darr247 earned 500 total points
ID: 39276494
The date/time stamp on the lmhosts.sam file in the original post identifies it as win7 (aka v6.1.xxxx)

Click the 'start' orb, type in cmd, hold down a Shift key and a Ctrl key (aka Ctrl+Shift), hit Enter, then release the Ctrl and Shift keys. Or, right-click the cmd (or cmd.exe, depending if you have known extensions visible) that then appears at the top of the start menu and choose Run as administrator.

From the Administrator window that opens...
If the C:\Windows\System32\drivers\etc\HOSTS file already exists, run
notepad C:\Windows\System32\drivers\etc\hosts
If hosts has not yet been created, run
notepad C:\Windows\System32\drivers\etc\hosts.sam
then use File -> Save As...
in the Save As dialog that opens, change the Save as type picklist to All Files (*.*), and the File name to simply hosts without the sam extension (if you don't change the picklist to 'All Files', you'll need to put "double quotes" around the name "hosts" or notepad will automatically add the .txt extension).

You might still need to take ownership of the C:\Windows\System32\drivers\etc sub dir, but some have reported only needing to run notepad as an administrator to be able to save the new HOSTS file there.
0
 

Author Closing Comment

by:walkerdba
ID: 39276868
yes
0
 
LVL 12

Expert Comment

by:ktaczala
ID: 39276889
Hmm, my answer was basically the same as Darr247 & I posted first so why didn't I get the credit?
0
 
LVL 44

Expert Comment

by:Darr247
ID: 39286778
I figured it was the take ownership instructions. I've never been able to save edits to hosts or lmhosts in Win7 without taking ownership and adding 'Full Control' permission for them (also on the Security tab), so besides the alternate way to run notepad as administrator, I added that link (http://technet.microsoft.com/en-us/library/cc753659.aspx ).
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to set permissions to allow a limited-permissions user to start and stop a particular System Service.   It is always best to give users only the permissions that they need to perform their job, so tweaking particular permi…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question