Category cmd

DB backup script

:: preparing date and time         for /f “tokens=2 delims==” %%a in (‘wmic OS Get localdatetime /value’) do set “dt=%%a” set “YYYY=%dt:~0,4%” & set “MM=%dt:~4,2%” & set “DD=%dt:~6,2%” set “HH=%dt:~8,2%” & set “Min=%dt:~10,2%” & set “Sec=%dt:~12,2%” set…

Send mail from command prompt using powershell

Commands: powershell$EmailFrom = “”$EmailTo = “,”$Subject = “The subject of your email”$Body = “This is just a test mail to verify the working of CMD”$SMTPServer = “”$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)$SMTPClient.EnableSsl = $true$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“”, “senderPassword”)$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)pause

Enable Notifications OK No thanks