Topic "Editing batch files"

Author Message
[View user's profile]

Joined: 2005-03-17
Posts: 1
Location: Hartwell, Georgia
I am using WinSCP 3.7.4 (build 271) accessing Linux servers. I use the Norton command interface.

I often edit both Unix and Windows text files on these servers. Example: netlogon.bat and numerous *.cmd or *.bat files in Windows cr/lf text format, as well as Unix scripts in lf format.

My problem is that when I edit a batch file such as netlogon.bat with the internal WinSCP editor, it strips out the carriage returns and makes it unreadable by the Winodows machines.

Likewise, I do not want to introduce carriage returns in the Unix shell scripts and other similar files.

I have tried numerous combinations of the various settings in WinSCP and can't seem to hit on the right method. I have searched this forum and the web in general but have not seen this problem specifically addressed.

I would very much prefer to use the internal editor vs notepad. Also I frequently have to download WinSCP on a client's machine to access the server so I don't want to carry along another editor program. However, I would welcome a suggestion for an editor that would deal with this problem.

Is there a recommended combination of settings to easily handle both Windows and Unix script files?

Thanks for a great product!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
Internal editor works only with Windows style line endings. So WinSCP always converts the remote file before it opens it in the internal editor (an coverts it back when upliding the file back). Problem is that WinSCP does not expect presence of text files in different formats on remote server.

So unfortunatelly to solve your problem you need to use external editor that supports both unix and windows style text files and make sure you use binary transfer mode when downloading to/uploading from the editor. See Editing binary files.

About editor: I use integrated editor of my favourite file manager (FAR). However I believe that you won't have problem finding some (try and
Martin Prikryl

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License