MS-DOS how to save a file opened with "edit"?

7

I'm trying to open a file from the command with this line: "edit file_name"

And I would like to save it after I have modified it.

Do you know the way to do this ?

Cheers

mric750

Posted 2016-09-24T13:54:05.807

Reputation: 97

Try edlin instead. ;-) – Brad – 2016-09-25T04:23:01.257

@Ok but how do you exit and save from within a edlin session ? – mric750 – 2016-09-25T11:20:32.663

@mric750 Again, Google is your friend here, first hit gave me the answer on how to save in edlin, type e and press enter for End and Save. https://support.microsoft.com/en-us/kb/67706

– acejavelin – 2016-09-25T15:30:42.260

Answers

11

You press ALT key to activate the menu at the top of the screen, then use arrow keys or press F for the File menu, followed by S for Save or A for Save As

This information is easily available in the built in help system by pressing F1 or a quick Google search.

Reference: http://www.is.wayne.edu/DRBOWEN/InetF03/Edit/UsingDosEdit.htm

acejavelin

Posted 2016-09-24T13:54:05.807

Reputation: 5 341

I forgot to say that I can only use the command line => no menu – mric750 – 2016-09-24T14:15:34.737

11You said the MS-DOS edit command, that runs the full screen text editor, are you using a different command? – acejavelin – 2016-09-24T14:16:49.113

2@mric750 Command line programs can have menus too. Some even support mouse. – gronostaj – 2016-09-24T14:37:14.943

3EDIT actually supported mouse, but for some reason not in CMD. – Ray – 2016-09-24T19:11:17.763

1It supports mouse in CMD too, AFAIK. Perhaps you were using an older version @RayKoopa? – wizzwizz4 – 2016-09-24T20:22:33.263

3You need the DOS mouse driver installed. (Goes in Config.sys, generally as some form of LOAD statement.)

Windows 95/98 had a (somewhat flaky) pass-through for the Windows cursor that DOS programs using the mouse could use.

Some versions require you to explicitly load a DOS mouse driver if you want one. I don't recall the permutations, but if you have no mouse in DOS, that's usually why.

EDIT is a fullscreen text editor that has useful menus and mouse support. It's not as good for your geek cred as EdLin, or VI, but that's only because it's actually worth using. – The Nate – 2016-09-24T20:54:44.830

@wizzwizz4 Well I don't recall exactly anymore, since it is a 16-bit tool and thus not shipped with 64-bit Windows which I'm using for years. – Ray – 2016-09-24T21:50:21.647

@wizzwizz4 Yes but EDIT itself is a 16-bit program... now you actually make me try it. – Ray – 2016-09-25T07:41:36.993

@RayKoopa In order to get it to work you'll have to write a Kernel-mode assembly program to set up the processor before and after running NTVDM code. – wizzwizz4 – 2016-09-25T07:45:28.803

@wizzwizz4 I'm pretty sure you can't simply do that just out of thin air – Ray – 2016-09-25T07:58:59.197

@RayKoopa There's going to be quite a bit of undefined behaviour you can exploit in the chips, e.g. https://en.wikipedia.org/wiki/Unreal_mode

– wizzwizz4 – 2016-09-25T08:02:34.900

@wizzwizz4 You can't simply execute assembly code which switches the CPU mode under Windows. – Ray – 2016-09-25T10:14:52.653

@RayKoopa You can if you set up a Kernel-mode driver! :-) It's hard, but theoretically possible. – wizzwizz4 – 2016-09-25T16:25:53.853

@wizzwizz4 Yes of course it is possible with a driver, but you mentioned a simple "program" which is most commonly implicitly describing an executable ran without direct CPU access. – Ray – 2016-09-25T20:16:02.823

Let us continue this discussion in chat.

– Ray – 2016-09-25T20:16:05.327