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
  • 117

1 Answers1

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

shA.t
  • 498
acejavelin
  • 6,528
  • I forgot to say that I can only use the command line => no menu – mric750 Sep 24 '16 at 14:15
  • 11
    You said the MS-DOS edit command, that runs the full screen text editor, are you using a different command? – acejavelin Sep 24 '16 at 14:16
  • 2
    @mric750 Command line programs can have menus too. Some even support mouse. – gronostaj Sep 24 '16 at 14:37
  • 3
    EDIT actually supported mouse, but for some reason not in CMD. – Ray Sep 24 '16 at 19:11
  • 1
    It supports mouse in CMD too, AFAIK. Perhaps you were using an older version @RayKoopa? – wizzwizz4 Sep 24 '16 at 20:22
  • 3
    You 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 Sep 24 '16 at 20:54
  • @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 Sep 24 '16 at 21:50
  • @wizzwizz4 Yes but EDIT itself is a 16-bit program... now you actually make me try it. – Ray Sep 25 '16 at 07:41
  • @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 Sep 25 '16 at 07:45
  • @wizzwizz4 I'm pretty sure you can't simply do that just out of thin air – Ray Sep 25 '16 at 07:58
  • @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 Sep 25 '16 at 08:02
  • @wizzwizz4 You can't simply execute assembly code which switches the CPU mode under Windows. – Ray Sep 25 '16 at 10:14
  • @RayKoopa You can if you set up a Kernel-mode driver! :-) It's hard, but theoretically possible. – wizzwizz4 Sep 25 '16 at 16:25
  • @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 Sep 25 '16 at 20:16