Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Unix I'd just use vi, but I don't know what the command is on Windows. I am actually trying to edit files over ssh with Windows Server 2008.

share|improve this question
2  
For which version of Windows? –  Snark Sep 10 '10 at 3:55
add comment

6 Answers

up vote 23 down vote accepted

edit filename

I won't vouch for its functionality and outdated GUI but it is installed by default, even on Windows 7.

Edit: Except 64 bit versions of Windows.

share|improve this answer
2  
On all versions of Windows? There is no "edit" on Windows 7 apparently. –  Snark Sep 10 '10 at 3:53
7  
Holy crap! I never knew that was there! –  yhw42 Sep 10 '10 at 3:54
3  
Odd... evidently it's installed by default on Windows 7 32-bit, but not on Windows 7 64-bit. That's sad. –  nhinkle Sep 10 '10 at 4:12
5  
@nhinkle: I seem to recall reading something about 16-bit apps being unavailable under 64-bit windows installs. –  intuited Sep 10 '10 at 4:34
2  
Just curious: can anyone confirm if this works using telnet/ssh? (RDP-ing into a Windows box I can see that the black DOS windows resizes itself when I start this, but I cannot SSH into that same box for some more testing.) –  Arjan Sep 10 '10 at 11:31
show 3 more comments

The simplest solution on all versions of windows is:

C:\>notepad somefile.txt

And, no extra software required.

share|improve this answer
5  
Nice, but not over SSH –  Casebash Sep 10 '10 at 4:10
1  
Ah. Right. Windows doesn't have a command-line editor built in. You'll probably need to install the Gnu version of the editor you want to use. Since you've already installed the ssh server, that should be no problem for you. –  BillP3rd Sep 10 '10 at 4:27
    
Like BillP3rd said... just run cmd as administrator, then enter notepad filename, save it and that's it. ;) –  tastro Feb 28 at 13:57
    
Like OP said... "I am actually trying to edit files over ssh..." –  daviewales Apr 13 at 3:16
add comment

If you're used to vi and don't want to settle for the built in editor you can get vim for Windows. It'll run from a command shell. Or try WinVi.

share|improve this answer
add comment

Believe it or not, EDLIN.EXE is still around <shudder> at least on this Vista system.

Excuse me while I sob softly to myself...

share|improve this answer
1  
It was finally deleted in Windows 7 (at least the 64-bit versions). –  paradroid Sep 10 '10 at 7:11
    
@jason404: It's still included in 32-bit Windows 7. –  Dennis Williamson Sep 10 '10 at 15:08
add comment

From a windows command prompt enter copy con followed by the target file name. (copy con c:\file.txt)

Then enter the text you want to put in the file.

End and save the file by pressing CTRL-Z then Enter.

If you want to change text in an existing file simply display the text by using the command type followed by the file name and then just copy and paste the text in to the copy con command.

Hope that helps :-)

share|improve this answer
1  
Hard core. Try not to make any typos, or you'll have to start over again. Well, backspace does work if you catch the mistake before you press Enter. –  Kevin Panko Dec 3 '13 at 18:57
add comment

I don't know about SSH, or anything (else?) server-related, so forgive me if this "solution" is useless. If you want to edit files in the Command Prompt, you can get the Windows version of Nano.

As a side note, those little ^ signs at the bottom of the window are supposed to represent the Ctrl button. For instance, ^X Exit means that you can exit the program using Ctrl-X.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.