PUSHD OTP set Logfile=SendOTP.log echo ***** >> %Logfile% echo %DATE% %TIME% OTP:%1 IPaddress:%2 Email:%3 MobilePhone:%4 >> %Logfile% IF %4=="email" ( SendSMTPmail.exe -u sender@xyz.com -r %3 -h mailhost -port mailport -ssl -user logonuser -pass logonpassw -s "Your One Time Password is %1" -l SendOTP%1.txt ) ELSE ( rem A1: https://www.a1.net/prosms rem httpGet.exe "https://sms.b2b.telekom.at/mssms/rest/sendSms.do?username=xxx&password=xxx&recipients=%4&msgtext=Your_One_Time_Password_is_%1" -fc -nochk > SendOTP%1.txt rem esendex: https://www.esendex.com rem httpGet.exe "https://www.esendex.com/secure/messenger/formpost/SendSMS.aspx?username=xxx@xxx.com&account=ex0xxxxxx&password=xxx&recipient=%4&body=Your_One_Time_Password_is_%1&plaintext=1" -fc > SendOTP%1.txt rem esendex v2 API: https://api.esendex.de rem HttpPost.exe esendex.json https://api.esendex.de/v2/messages -h "Content-Type:application/json" -h "X-Api-Key:xxx" -r "?OTP?:%1" -r "?number?:%4" -r "?account?:EXDE00xxx" -e100 -v > SendOTP%1.txt ) echo ERRORLEVEL=%ERRORLEVEL% >> %Logfile% if exist SendOTP%1.txt type SendOTP%1.txt >> %Logfile% if exist SendOTP%1.txt del SendOTP%1.txt