Solved

why edit not working

Posted on 2013-06-24
14
468 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +2
14 Comments
 
LVL 55

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 96

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 55

Expert Comment

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

~bp
0
Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

 
LVL 96

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 96

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 55

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Many times while working on a computer regardless of any Operating System, lag and crashes seem to creep in, hindering your working speed. Sometimes, it can also cause your work to be lost unexpectedly and as a result, you are unable to meet your de…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

690 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