简体   繁体   中英

“edit” not a valid command in cmd.exe?

I'm trying to create a .cfg file for bcc32 compiler and I'm following the instructions. I have installed correctly and placed an environment path as instructed but when I type "edit bcc32.cfg" into the command prompt it says that edit isn't a valid command? What am I supposed to do?

You could also create a .bat file, edit.bat , to replace the 16-bit edit program (removed because x64 windows flavors won't run it) which would launch your favorite editor.

@echo off
notepad %1
@echo on

This is what I wound up doing as a simple patch so I could carry on the way I always had for the most part. Just type:

edit myfile.ext

in the command prompt to use it.

Note: notepad is not my favorite editor - this is just an example that will work with stock windows.

Note 2: @echo off and @echo on are shown for clarity. You may also shorten this by omitting the echo statements and simply placing the @ before the command to be silenced.

@notepad %1

I just use notepad (since they took out the edit command) from the command window like so:

 C:\Borland\BCC55\bin> notepad bcc32.cfg

The file will open in notepad for editing. When you've finished editing the file, save it and you're done.

I have found this works for seeing in-window text of a complete file, on a 64bit machine. Once your path is set in cmd prompt, type the word type... followed by "filename" do you see how I used the quotes around the filename only!

type "filename"

You type it just like this (changing filename for your files name) and you will be able to see the entire file text in the cmd window. Not sure how to edit from here on but maybe someone can figure it out from here and tell me.

Assuming you're using Windows 7 (where edit.exe and edlin.exe have been removed): Use powershell.exe instead of cmd - thereby edit will be available via command line.

Take a look at: http://en.wikipedia.org/wiki/Windows_PowerShell

simple answer.... if your using an old version of windows (xp etc..) you would be able to use edit but since your using new version of windows, Microsoft has updated and removed the commands that they think are not relevant eg. (msg, edit) depending if its a bit32 bit64 or bit82...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM