Command line arguments
Command line arguments
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.
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:\
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:\
Hi,
thanks for this hint! 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.
thanks for this hint! 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.