#28594 - 2002-09-09 11:04 AM
hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
I finaly have a working mailscript (tnx guys) but it only works when outlook is already open. I want it to be a stealth mail program so the users doesnt see/know it (nope no virus). Richard Howarth thinks its not possible. i think it is (sue me). so is there anyway to hide/stealth an windows program (outlook)
this is the script im using now
code:
$Root = CreateObject("Outlook.Application") $MailItem = $Root.CreateItem(0) $MailItem.Importance=2 $MailItem.Subject = "Automation Test" $MailItem.To = "bla@@bla.com" $MailItem.Body = "KiXtart sending mail test" $MailItem.Attachments.Add("E:\kix\text.txt") $MailItem.Send
|
Top
|
|
|
|
#28596 - 2002-09-09 11:14 AM
Re: hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
you said my outlook method.. im always open to suggestions so please explain
[edit] i heard from more people that what i want isnt possible then 1 step back. is it possible to minimize it on startup? [ 09. September 2002, 11:45: Message edited by: Lord_mithril ]
|
Top
|
|
|
|
#28597 - 2002-09-10 12:05 AM
Re: hiding/stealthing outlook?
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
You have a number of problems to get around.
One of the most obvious that I can think of is where someone has multiple messaging profiles, such as on a laptop.
When you start an application such as Outlook you may need to select the profile to use.
If you have a fixed profile name you can get around it with command line switches. You may be able to use other switches to keep the process quiet.
More information about Outlook command line switches can be found here
|
Top
|
|
|
|
#28599 - 2002-09-10 12:58 AM
Re: hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
sue me for being stupid lonkero but how do i put that in my source? or do you have a link to the page where you got that from?
|
Top
|
|
|
|
#28601 - 2002-09-09 01:52 PM
Re: hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
doesnt work.. i dont get any error s but it just doesnt do anything
|
Top
|
|
|
|
#28603 - 2002-09-09 01:59 PM
Re: hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
$MailItem.windowstate(2) doesnt do a thing $MailItem.windowstate = 2 gives an unexpected expression. thnx anyway.
i have also been looking for a way to close outlook when the script is finished. but i only found how to close files..
|
Top
|
|
|
|
#28604 - 2002-09-09 02:52 PM
Re: hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
nobody? if anybody knows how to close a program please enlighten me
|
Top
|
|
|
|
#28605 - 2002-09-09 02:53 PM
Re: hiding/stealthing outlook?
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Manage applications (like Outlook) by sending keystrokes using SendKeys().
The keystroke "Alt-F4" will normally close an application, or you can navigate the menus.
You will have to deal with these things as well:
- Open dialogues about unsaved messages / autoarchiving / calendar reminders
- Timing - you don't want to close the application until the message has actually been sent
- Your sent message will linger in the users sent items folder
- Your users may get a little peeved if you keep closing Outlook while they are using it
Does your Exchange server have an SMTP service running? If it does, save yourself an awful lot of aggravation and give blat a whirl. You can download it from the BLAT home page.
|
Top
|
|
|
|
#28606 - 2002-09-09 02:55 PM
Re: hiding/stealthing outlook?
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
look up the UDF FindProc()
|
Top
|
|
|
|
#28608 - 2002-09-09 04:25 PM
Re: hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
thnx radimus its worked
|
Top
|
|
|
|
#28609 - 2002-09-10 08:41 AM
Re: hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
Radimus the FindPROC() solution works fine, but it doesnt give an output.. (my boss keeps changing / adding idears ) outlook only needs to close when it wasnt open before..
code:
if outlook = open runscript dont close Else start outlook run script close endif
this is the idear...
this is radimus' idear but it doesnt have output.. (or im going blind) is it easy to add or do i need another way?
code:
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
|
Top
|
|
|
|
#28611 - 2002-09-10 09:25 AM
Re: hiding/stealthing outlook?
|
Lord_mithril
Fresh Scripter
Registered: 2002-09-04
Posts: 26
|
ok this could be the dumbest thing i have ever written but im still a complete newb with programing..
code:
FindPROC("outlook.exe",,0) .... If $Process.ProcessId = "0" FindPROC("outlook.exe",,0) Else FindPROC("outlook.exe",,1) EndIf
it suprised me that there were no errors but outlook still closes.. i think im on the right track.. (or am i really derailed now?)
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 239 anonymous users online.
|
|
|