Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 474
  • Last Modified:

why edit not working

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
walkerdba
Asked:
walkerdba
  • 4
  • 3
  • 3
  • +2
1 Solution
 
Bill PrewCommented:
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
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
I don't think Edit has been around since Microsoft dropped QBasic. (The QBasic Editor was the same, I believe).
0
 
Bill PrewCommented:
I have it on Windows 7.

~bp
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Lee W, MVPTechnology and Business Process AdvisorCommented:
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
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
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
 
ktaczalaCommented:
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
 
Bill PrewCommented:
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
 
ktaczalaCommented:
good point.
0
 
ktaczalaCommented:
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
 
Darr247Commented:
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
 
walkerdbaAuthor Commented:
yes
0
 
ktaczalaCommented:
Hmm, my answer was basically the same as Darr247 & I posted first so why didn't I get the credit?
0
 
Darr247Commented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now