Salve,
vorrei chiedervi aiuto per la creazione di un file .bat che dovrebbe:
-Prelevare un files chiamato esempio.cfg (contenuto nella stessa cartella dov'è il files .bat)
- inviarlo tramite ftp o tramite mail.
io ho iniziato a fare lo script
codice:
@ECHO OFF
SETLOCAL EnableExtensions
REM Connection information:
SET Server=mieidati
SET UserName=mieidati
SET Password=mieidati
REM ---- Do not modify anything below this line ----
SET Commands="%TEMP%SendToFTP_commands.txt"
REM FTP user name and password. No spaces after either.
ECHO %UserName%> %Commands%
ECHO %Password%>> %Commands%
REM FTP transfer settings.
ECHO binary >> %Commands%
IF /I {%1}=={/L} (
REM Add file(s) to the list to be FTP'ed.
FOR /F "usebackq tokens=*" %%I IN ("%~dpnx2") DO ECHO put %%I >> %Commands%
) ELSE (
ECHO put "%~dpnx1" >> %Commands%
)
REM Close the FTP connection.
ECHO close >> %Commands%
ECHO bye >> %Commands%
REM Perform the FTP.
FTP -d -i -s:%Commands% %Server%
ECHO.
ECHO.
REM Clean up.
IF EXIST %Commands% DEL %Commands%
Con questo bisogna trascinare il file da inviare su questo .bat io invece vorrei che se trova il file loginsetting.cfg nella cartella dov'e il file .bat lo invia in automatico.
Ma non so come fare