Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TYPE and EDIT in Recovery Console 1

Status
Not open for further replies.

travisbrown

Technical User
Dec 31, 2001
1,016
I needed to boot up into the recovery console because I made a typo in the boot.ini file when I was switching some drives around.

Umm...what happened to the EDIT command? I can use TYPE and read files from the prompt, but can't edit them. Is there a way to create or edit files fron the command console? My current solution is to create a boot.ini on another computer and save it to floppy so I can copy it to my problem machine.
 
you could put edit.com on a boot floppy. Or vi, or some other small text editor. Or as you said, edit the file on another machine.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
mrdenny: Thanks. I'll keeps a floppy around with a text editor for next time I mess things up. I managed by going into work and using another machine to rewrite the boot.ini, but was a bit annoyed that there wasn't a basic way to edit in recovery console. Edit still works in the command prompt in windows.

willshakespeare: yes, I know about bootcfg, but I was booting up with Windows 2000 startup discs (the other OS on the machine; I didn't have Win2k3 startup discs). No bootcfg command in Windows2000 RC, though.
 
Sorry, I forgot... Windows 2000 uses copy con, like old MSDOS:

DOShelp said:
If you are unable to find edit.com on your hard disk drive you can also use the following command to create a file.

copy con <name of file>

Once you have entered the above command this will create the file by the name specified.
Once you have typed all the lines you wish to be in the file press and hold CTRL + Z. This should enter ^Z, once on the screen press the enter and one file should be copied.

Here is an example from my XP dos prompt:
Code:
[b]
C:\Program Files\Support Tools>copy con c:\hello.txt
Here is my boot ini file.
^Z
        1 file(s) copied.

C:\Program Files\Support Tools>
[/b]

Essentially, you type copy con <filename>, then press Enter.
In your case: c:\boot.ini

Then, you type the info you want in the file:
In your case (similar to):

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows 2000" /fastdetect /NoExecute=OptIn


Then you hit Ctrl-Z and ^Z appears. You then hit Enter, and the file is created.

Will
[morning]
 
The above is very useful. I made the comment about the floppy before you suggested this.

Thank-you kindly.
 
Sorry... I was only being silly... I figured you just hadn't had time to see it.
I remember this from about 6years ago I worked for a company called TRO, taken over by Vega, which had DOS based software which was CBT for commercial pilots. Learned a LOT of DOS things, and copy con was one of them... oddly enough, if you do copy /? or copy con /?, or similar, there is no info about it! Possibly because from DOS 5.x onwards, edit.com was available, so they saved space by not mentioning it... who knows!

It's funny because originally when you said you couldn't use type to edit the file, only view it, I was suspicious, and thought, "That's wrong... we used to use type to edit files at TRO". It was actually copy con I was remembering, but getting mixed up because we used type to view the files, regularly. You see I remembered the Ctrl-Z and how to use the command I had in mind, and thought was type, but I was mistaken, obviously, because type is not that useful! In fact, I think my confusion was because of a discussion I now remember I had with my boss about how stupid to name a command type when you couldn't TYPE anything to the file! He was the one who originally introduced me to copy con.

So I did some searching with using type in mind, and found bootcfg which I knew, but had forgotten. With your reply, though, I thought, "Surely there must be a way to use type to edit a file!" I was determined!

I then decided to search for DOS commands create edit files in Google, when suddenly I found copy con and it all flooded back! In fact the top page hit was this:

Note on the above page, it is more of a side-note that if you have DOS 4.x or less... wouldn't it be useful for Windows 2000 Recovery People to know??? Silly Microsoft (as usual) [smile]

Glad to help!

Will
[morning]
 
I know. Edit should be such a simple and documented function, especially in a text-based environment. Sigh. Thanks for the help. They take out the one everyone knows about and leave in the one everyone's forgotten about.

Oddly enough, EDIT works from the command prompt once you have windows up and running.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top