Command line arguments

Requests, suggestions and other questions related to Core FTP Mini Server
Locked
srad
Posts: 1
Joined: Tue Feb 06, 2007 8:04 pm

Command line arguments

Post by srad »

I know that you can set it to automatically start via the -start command line option. I would really love to be able to set the username, password, port, and path via command line arguments. Is this possible? Having it just remember the last settings used is not really sufficient for my situation. Thanks.
pyro409
Posts: 1
Joined: Fri Mar 30, 2007 1:47 pm

Post by pyro409 »

I managed this by rolling up a batch file. the first version simply rewrote the entries in the registry (hkey_current_user\software\ftpware\msftpsrvr\msftpsrvr) using the "regedit core.reg /s" with pre fabricated registry files.

I later started using the echo command tin the batchfile and command line arguments to change values. E.G. (startftp.bat )

echo Windows Registry Editor Version 5.00 > c:\temp.reg
echo [HKEY_CURRENT_USER\Software\FTPWare\msftpsrvr\msftpsrvr] > c:\temp.reg
echo "PW"="%1" > c:\temp.reg
echo "Port"="%2" > c:\temp.reg
echo "User"="%3"
"Path"="%4"
regedit c:\temp.reg /s
del c:\temp.reg
start c:\ftp\msftpsrvr.exe /start

This allows the following command line options to work

startftp mypass 57193 myuser v:\
TFojuth
Posts: 1
Joined: Thu Mar 27, 2008 8:55 am

Post by TFojuth »

Hi,
thanks for this hint! :D It works quite fine though i would recommend to correct/change some small things in the batch script:

[code]
echo Windows Registry Editor Version 5.00 > c:\temp.reg
echo [HKEY_CURRENT_USER\Software\FTPWare\msftpsrvr\msftpsrvr] >> c:\temp.reg
echo "PW"="%1" >> c:\temp.reg
echo "Port"="%2" >> c:\temp.reg
echo "User"="%3" >> c:\temp.reg
echo "Path"="%4" >> c:\temp.reg
regedit c:\temp.reg /s
del c:\temp.reg
start c:\ftp\msftpsrvr.exe /start
[/code]

... hmm, the code-tags seem to be not working at all. :?
Locked