Remove entries from FTP 'Change Directory' combobox

FTP, SFTP, FTPS, and SSH/telnet console issues

Remove entries from FTP 'Change Directory' combobox

Postby iguanodon » Fri Jul 24, 2009 9:53 am

How Can I remove entries from the FTP 'Change Directory' combobox? For some accounts the list has grown quite large, and there are lots of directories I don't use any more.
iguanodon
Newbie
 
Posts: 3
Joined: Tue Dec 09, 2008 9:24 am

Re: Remove entries from FTP 'Change Directory' combobox

Postby Mofi » Sun Jul 26, 2009 11:25 am

I never used the FTP feature of UE, and so don't know where the directories are really stored. But the directories can be only saved in uedit32.ini or in the file configured at Configuration - FTP - Store FTP accounts and settings in user selected file. You should be able to open the files and delete the not anymore used directories. The full path and name of the INI file is displayed at Configuration - Application Layout - Advanced.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Remove entries from FTP 'Change Directory' combobox

Postby iguanodon » Wed Jul 29, 2009 10:04 am

Thanks, the info was in my FTP account user selected file. Unfortunately the paths are stored hex encoded, so it's pretty hard to tell which ones to delete. For example:

Path History New0=2F6578706F72742F686F6D65

I was able to delete all of the 'Path History*' entries and start from scratch, which for me is better than having all of the old paths in the drop-down.
iguanodon
Newbie
 
Posts: 3
Joined: Tue Dec 09, 2008 9:24 am

Re: Remove entries from FTP 'Change Directory' combobox

Postby Mofi » Wed Jul 29, 2009 10:46 am

Aha, nice to know, thanks.

Without having a test file I have written quickly a small script which copies the active file to a new file if it contains the case-sensitive string "Path History New" and converts all the path history entries in hexadecimal to ASCII in this new file. So you should get a copy of your file with the account data with readable path history entries. I hope this litte script is helpful for you or somebody else.

Please note: It does not contain any checks on valid data. It is really a quick and dirty script.

Code: Select all
// This little script converts path history entries in hex to ASCII.

if (UltraEdit.document.length > 0) {
   UltraEdit.insertMode();
   UltraEdit.columnModeOff();
   UltraEdit.ueReOn();
   UltraEdit.activeDocument.top();
   UltraEdit.activeDocument.findReplace.mode=0;
   UltraEdit.activeDocument.findReplace.matchCase=true;
   UltraEdit.activeDocument.findReplace.matchWord=false;
   UltraEdit.activeDocument.findReplace.regExp=false;
   UltraEdit.activeDocument.findReplace.searchAscii=false;
   UltraEdit.activeDocument.findReplace.searchDown=true;
   UltraEdit.activeDocument.findReplace.searchInColumn=false;
   if (UltraEdit.activeDocument.findReplace.find("Path History New")) {
      UltraEdit.selectClipboard(9);
      UltraEdit.activeDocument.selectAll();
      UltraEdit.activeDocument.copy();
      UltraEdit.newFile();
      UltraEdit.activeDocument.paste();
      UltraEdit.clearClipboard();
      UltraEdit.selectClipboard(0);
      UltraEdit.activeDocument.top();
      UltraEdit.activeDocument.findReplace.regExp=true;
      while (UltraEdit.activeDocument.findReplace.find("Path History New[0-9]+=")) {
         UltraEdit.activeDocument.findReplace.find("[0-9A-Fa-f]+");
         var sHexPath = UltraEdit.activeDocument.selection;
         var nPathLength = sHexPath.length;
         var sAsciiPath = "\"";
         for (var nCharIndex = 0; nCharIndex < nPathLength; nCharIndex += 2) {
            var sHexValue = sHexPath.substr(nCharIndex,2);
            var nCharCode = parseInt(sHexValue,16);
            sAsciiPath += String.fromCharCode(nCharCode);
         }
         sAsciiPath += "\"";
         UltraEdit.activeDocument.write(sAsciiPath);
      }
   }
}
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Remove entries from FTP 'Change Directory' combobox

Postby iguanodon » Thu Jul 30, 2009 1:49 pm

Thanks, Mofi! That quick and dirty script worked like a charm!
iguanodon
Newbie
 
Posts: 3
Joined: Tue Dec 09, 2008 9:24 am


Return to FTP/SFTP / SSH/Telnet

cron