Page 1 of 2 12>
Topic Options
#28594 - 2002-09-09 11:04 AM hiding/stealthing outlook?
Lord_mithril Offline
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
#28595 - 2002-09-09 11:13 AM Re: hiding/stealthing outlook?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I think richard is right on that.

with your outlook method anyway.
 
_________________________
!

download KiXnet

Top
#28596 - 2002-09-09 11:14 AM Re: hiding/stealthing outlook?
Lord_mithril Offline
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 [Frown]
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 Offline
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
#28598 - 2002-09-10 12:13 AM Re: hiding/stealthing outlook?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, minimized, quick search on outlook scripting help gives:
quote:
WindowState Property

Returns or sets the window state of an explorer or inspector window. Can be any of the following OlWindowState values: olMaximized(1), olMinimized(2), or olNormal(3).

Read/write Long.

Syntax

object.WindowState

object Required. An expression that returns an Explorer or Inspector object.

_________________________
!

download KiXnet

Top
#28599 - 2002-09-10 12:58 AM Re: hiding/stealthing outlook?
Lord_mithril Offline
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
#28600 - 2002-09-09 01:45 PM Re: hiding/stealthing outlook?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what about:
$Root = CreateObject("Outlook.Application")
$Root.windowstate(2)

haven't tried it with outlook...

it's not from any page but from outlooks own help.
_________________________
!

download KiXnet

Top
#28601 - 2002-09-09 01:52 PM Re: hiding/stealthing outlook?
Lord_mithril Offline
Fresh Scripter

Registered: 2002-09-04
Posts: 26
doesnt work.. i dont get any error s but it just doesnt do anything [Frown] [Confused] [Frown]
Top
#28602 - 2002-09-09 01:53 PM Re: hiding/stealthing outlook?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what about:
$MailItem.windowstate(2)
or:
$MailItem.windowstate = 2
_________________________
!

download KiXnet

Top
#28603 - 2002-09-09 01:59 PM Re: hiding/stealthing outlook?
Lord_mithril Offline
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 Offline
Fresh Scripter

Registered: 2002-09-04
Posts: 26
nobody?
if anybody knows how to close a program please enlighten me [Smile]

Top
#28605 - 2002-09-09 02:53 PM Re: hiding/stealthing outlook?
Richard H. Administrator Offline
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 [Eek!]
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 Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
look up the UDF FindProc()
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#28607 - 2002-09-09 03:06 PM Re: hiding/stealthing outlook?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
close?

closing would be something like:

application.quit
application.close
application.exit

pretty much depending on the application.
_________________________
!

download KiXnet

Top
#28608 - 2002-09-09 04:25 PM Re: hiding/stealthing outlook?
Lord_mithril Offline
Fresh Scripter

Registered: 2002-09-04
Posts: 26
thnx radimus its worked [Smile]
Top
#28609 - 2002-09-10 08:41 AM Re: hiding/stealthing outlook?
Lord_mithril Offline
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 [Smile] )
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
#28610 - 2002-09-10 09:13 AM Re: hiding/stealthing outlook?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, to my eye it seems that the output is:
$FindPROC=$Process.ProcessId

this means that the output is the last line in the array of process id's...

if no matching process found, it returns nothing.

cheers...
_________________________
!

download KiXnet

Top
#28611 - 2002-09-10 09:25 AM Re: hiding/stealthing outlook?
Lord_mithril Offline
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 [Smile] but outlook still closes.. i think im on the right track.. (or am i really derailed now?)

Top
#28612 - 2002-09-10 10:15 AM Re: hiding/stealthing outlook?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you could do (if you use that udf):

if findproc("outlook.exe")
"outlook already open"
else
"outlook not opened yet"
endif
_________________________
!

download KiXnet

Top
#28613 - 2002-09-10 10:19 AM Re: hiding/stealthing outlook?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
To use FindPROC you will need to have WMI available on every machine that you will run it on.

You don't get an error, because there is no error checking in the UDF.

If WMI is not available nothing is returned, and your script will then assume that Outlook is not running.

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 132 anonymous users online.
Newest Members
MaikSimon, kvn317, kixtarts2025, SERoyalty, mytar
17872 Registered Users

Generated in 0.074 seconds in which 0.026 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org