Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. $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