Pre.exe is specially created for use on the Raiden ftp server. Raiden supports the so called ASK interface which is quite a handy mechanism to allow/disallow certain commands and give user feedback. To see more go to www.raidenftpd.com/en or more specifically to http://www.raidenftpd.com/kb/kb000000014.html . Also dont forget to visit the forums since there are various explanations on how to use the ASK interface. The ASK interface supports the following events, these are listed in your Raiden .ftpd file. To make it easier I have listed the ones that are interested here. Executed AFTER the command happened: OnFileDeleted OnFileUploaded OnZipUploaded Executed BEFORE the command happened: - onUserLogin : executed before the user login procedure is permitted - onFilePreUpload : executed before the user can gain the permission to upload a file - onNewDir : executed before the user creates a directory - onFilePreDelete : executed before the user actually deletes a file - onDelDir : executed before the user actually deletes a directory - onPreCwd : executed before the Change Working Directory event Pre works on the proper use of its parameters. The parameters are: ASK= This is the name of the file that is being created for raiden. Allow= This is the message that is given back to the user via the ask interface, if the command is allowed Deny= This is the message that is given back to the user via the ask interface, if the command is denied Param= This is the parameter line you want to check, for example you would want to place the full file name in here. So in this case you would have to know what the Raiden ftp variables for convenience they are repeated below. The %m is very interesting in our case and the %S variable also is interesting. Section= This it the section in the FTPServerTools.ini that is being used to read the Line1= Line2= etc.. Such a Line1= holds the line (wildcards allowed) against which the Param= parameter is checked. So if I have Section=OnFilePreUpload then in FTPServerTools.ini we have for example: [OnFilePreUpload] Allow1=*\.message Allow2=*\.race* All the parameters will be treated case INsensitevely! Now the lines in the ini file are either Allow= Deny= and/or Unless= lines. The lines will be evaluated in order they are in the ini file! Allow= If a line matches then raiden is told that the command is allowed. Deny= These lines tell whether the command should be denied. If a line matches then the program stops and tells raiden to deny the command. Unless= Tell that a command is denied Unless it matches. And if it comes through all this then it also matches. e.g. [OnFileUpload] Allow=*\private\.message allow upload of .message file into the private dirs Deny=*\.message deny .message files for the rest Unless=*.zip now deny everything unless it is a zip file So now up to the examples: OnFilePreUpload e.g. OnFilePreUpload=ask://C:\Program Files\RaidenFTPD\Pre.exe ASK="c:\Program Files\RaidenFTPD\Output\ask-OnFilePreUpload.%@" Section=OnFilePreUpload Deny="File upload denied" Allow="File accepted" Param="%m" OnFilePreDelete e.g. OnFilePreDelete=ask://C:\Program Files\RaidenFTPD\Pre.exe ASK="c:\Program Files\RaidenFTPD\Output\ask-OnFilePreDelete.%@" Section=OnFilePreDelete Deny="File delete denied" Allow="File delete accepted" Param="%m" OnNewDir e.g. OnNewDir=ask://C:\Program Files\RaidenFTPD\Pre.exe ASK="c:\Program Files\RaidenFTPD\Output\ask-OnNewDir.%@" Section=OnNewDir Deny="File upload denied" Allow="File accepted" Param="%m" OnPreCwd e.g. OnPreCwd=ask://C:\Program Files\RaidenFTPD\Pre.exe ASK="c:\Program Files\RaidenFTPD\Output\ask-OnPreCwd.%@" Section=OnPreCwd Deny="File upload denied" Allow="File accepted" Param="%m" OnUserLogin e.g. OnUserLogin=ask://C:\Program Files\RaidenFTPD\Pre.exe ASK="c:\Program Files\RaidenFTPD\Output\ask-OnUserLogin.%@" Section=OnUserLogin Deny="File upload denied" Allow="File accepted" Param="%S" and in FTPServerTools.ini [OnFilePreUpload] ;disallow upload of .message and .race* files Deny=*\.message Deny=*\.race* [OnFilePreDelete] ;disallow deletion of the main server rules.txt Deny=C:\FTP\rules.txt [OnNewDir] ;disallow creation of NUKE sub dirs Deny=C:\FTP\*\*NUKED [OnPreCwd] ;disallow anyone to enter the private dir Deny=C:\FTP\private [OnUserLogin] ;disallow anonymous users to login in Deny=anonymous ;disallow looklook to log in Deny=looklook A bit more complicated: [OnFileUpload] ;Allow .message to root dir to be uploaded Allow=C:\FTP\.message ;Disallow .message to any subdirs Deny=*\.message ;Deny everything to be uploaded except *.zip, *.r* and *.0?? files. Unless=*.zip Unless=*.r* Unless=*.0?? But you can have more fun with this tool!! OnUserLogin=ask://Pre.exe ASK="c:\Program Files\RaidenFTPD\Output\ask-OnUserLogin.%@" Section=OnUserLogin Deny="File upload denied" Allow="File accepted" Param="%S %g %C %i %P" ;Disallow a login when he is of the wrong Deny=* wrong * * * ;Disallow login when he is of a certain ip mask Deny=* * 192.168.*.* * * ;allow my friends to log in in spite of limits Allow=* friends * * * ;Disallow login when he has reached a certain download credits e.g. 10000 to 19999 K Deny=* * * 1???? * * So you can imagine the fun you can have with the use of this program and the ask interface. Your imagination and he raiden variables will determine the limits you can do with this tool. The exe returns with the following return codes: 0 - ask interface executed, match found, command should be denied 1 - ask interface executed, no match found, command should be allowed or Allow match found 2 - parameter error 4 - can not open ASK interface file if you already use my OnDirCreated.exe tool you dont need to use this tool for the NewDir event in raiden. Problem solving: If it doesnt work then look in your raiden window, the commandline that is executed is shown, Just check if you have all the paths right. Raiden variables (see http://www.raidenftpd.com/en/raiden-ftpd-doc/help-variables.html for the most up to date version): %S;name of logged in user %z;name of logged in user (left aligned with padding spaces up to 14 chars , do not use in *.vfs) new! %g;user's group %Z;user's group (left aligned with padding spaces up to 14 chars , do not use in *.vfs) new! %Y;user's tag line ( comment line , all spaces are replaced by %20 , do not use in *.vfs) new! %T;user's tag line ( comment line , left aligned with padding spaces up to 25 chars , do not use in *.vfs) new! %d;number of bytes downloaded in the current session %p;number of bytes uploaded in the current session %v;last download speed (kb/sec) %V;last upload speed (kb/sec) %x;history downloaded mega bytes new! %X;history uploaded mega bytes new! %w;history downloaded kilo bytes %W;history uploaded kilo bytes %C;user's credit (mega bytes)new! %c;user's credit (kilo bytes) %i;the IP address from which the user is logged in %D;the user's idle time %E;user's ratio (1:x or unlimited)new! %e;current directory %P;password of anonymous user (usually email address) , this will be empty value for normal users new! %h;server's name %u;server's up time ( HH : MM : SS ) format %y;string of today ( ex: 0707 for July 7th ) %U;server's startup time ( YYYY/MM/DD HH:MM ) %t;current date and time %N;maximum number of anonymous and registered users %n;number of users logged in (anonymous and registered) %f;free disk space under current virtual path ( not including virtual mount points ) %I;max allowed connections from the same IP %o;server output byte status new! %l;server input byte status new! %b;success files count in current *.sfv or *.md5 lists new! %R;files count in *.sfv or *.md5 files new! %H;the virtual dir/file name which the client just accessed (or accessing)by RETR/STOR/MKD/RMD and site nuke , however all space characters are converted to %20 new! %r;the virtual dir/file name which the client just accessed (or accessing)by RETR/STOR/MKD/RMD and site nuke/move new! %m;the full physical dir/file name which the client just accessed (or accessing)by RETR/STOR/MKD/RMD and site move new! %G;the full physical dir/file name which the client just accessed (or accessing)by RETR/STOR/MKD/RMD , however all space characters are converted to %20 new! %q;the full physical path name (short path name) which the client just accessed (or accessing) by RETR/STOR command new! %Q;the filename (short path name) which the client just accessed (or accessing) by RETR/STOR command new! %M;the filesize (in kilobytes) of the file which the client just accessed (or accessing) by RETR/STOR , or the target directory size for site move command new! %F;the reason of the directory just got nuked by site nuke command %j;the multiplier of the directory just got nuked by site nuke command %O;the reason of the file being marked as a dupe file (a file that already existed in this virtual file system) new! %L;Mp3 ID3 tag's song title , if the last file being uploaded is a mp3 file (30 chars with space appended) new! %k;Mp3 ID3 tag's artist name , if the last file being uploaded is a mp3 file (30 chars with space appended) new! %K;Mp3 ID3 tag's album name , if the last file being uploaded is a mp3 file (30 chars with space appended) new! %a;Mp3 header's bit rate , if the last file being uploaded is a mp3 file (10 chars with space appended) new! %J;Mp3 ID3 tag's year , if the last file being uploaded is a mp3 file (4 chars with space appended) new! %A;Mp3 header's sampling frequency , if the last file being uploaded is a mp3 file (8 chars with space appended) new! %B;Mp3 ID3 tag's genre , if the last file being uploaded is a mp3 file (32 chars with space appended) new! %s;Mp3 ID3 tag's genre , if the last file being uploaded is a mp3 file (32 chars with space appended) , however all space characters are converted to %20 new! %!;Whole string for site command , not including 'site' itself , this variable is for use with onSiteCmd event only (supported after v2.1 build 944) %0;output the latest 10 directories made on this server %1;output the top 10 uploaders on this server %2;output the top 10 downloaders on this server %3;output the current user's detail information %4;output the currently online users list %5;output the directory info of the current virtual directory , the directory info contains files , total file size , uploaders/groups information of the current virtual directory %#;output another *.msg file in /message dir , ex : %#site-help.msg , this will include the content of /message/site-help.msg into current *.msg file %%;percent character Version 1.0.0.0 First version. 1.0.0.1 Read the whole section and parse it line by line. Allow, Deny and Unless lines instead of Line1, Line2 ...