Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I sign a script so Outlook will run it without querying it.

Posted on 2002-04-05
5
Medium Priority
?
287 Views
Last Modified: 2008-03-17
Hi.

I've got a VBS script (below).

When I run it, Outlook XP says that there is another program running, sending email on my behalf.

What I want to do is :

1 - Get a digitial signature.
2 - Sign the script so that Outlook knows that it is from me.
3 - In the script, check that I will be allowed to send email.
4 - Tell Outlook only to allow signed/trusted scripts.

The script is ...

' AVUpdate.VBS (C) UK 2002 Carval Computing Ltd
' Author Richard Quadling
' Date Friday, 5 April 2002 12:37 12:37:53 PM
'
' This script is to be launched during the McAfee AntiVirus Update routines as follows.

' Define the necessary variables and objects.
Dim CurrentVersion, SDATFileName, FileSystem, CurrentFile, CurrentStream, INILine, OutlookApp, OutlookMailItem

' Create the FileSystem, Files and TextStreams Objects.
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set CurrentFile = FileSystem.GetFile("Updates (SDAT program for ALL platforms)\DELTA.INI")
Set CurrentStream = CurrentFile.OpenAsTextStream(1, 0)

' Get the CurrentVersion
With CurrentStream
    Do
        INILine = .ReadLine
    Loop While INILine <> "[Contents]"
    Do
        INILine = .ReadLine
        If Left(INILine, 15) = "CurrentVersion=" Then
            CurrentVersion = Right(INILine, 4)
        End If
    Loop While Mid(INILine, 1, 1) <> "["
End With

' Build the SDATFilename
SDATFileName = "V:\Updates (SDAT program for ALL platforms)\SDAT" & CurrentVersion & ".EXE"

' Does the SDAT file does exist.
With FileSystem
      if .FileExists(SDATFileName) = False Then
' Preserve the local SuperDAT.LOG file
            .MoveFile "Updates (SDAT program for ALL platforms)\SuperDAT.log", ".\"

' Copy everything to V:\Updates (SDAT program for ALL platforms).
            .CopyFile "Updates (SDAT program for ALL platforms)\*.*", "V:\Updates (SDAT program for ALL platforms)", True

' Restore the local SuperDAT.LOG file
            .MoveFile "SuperDAT.log", "Updates (SDAT program for ALL platforms)\"
      End If

' Check to see if the SDAT file does exist.
      If .FileExists(SDATFileName)  Then

' Copy the current SuperDat.log file as SuperDat CurrentVersion CCYYMMDD.log
            If .FileExists("V:\Updates (SDAT program for ALL platforms)\SuperDat.log") Then
                  .MoveFile "V:\Updates (SDAT program for ALL platforms)\SuperDat.log", "V:\Updates (SDAT program for ALL platforms)\SuperDat" + CurrentVersion + " " + Format(Date, "YYYYMMDD") + ".log"
            End If

' Email everyone about the new file.
      Set OutlookApp = CreateObject("Outlook.Application")
      Set OutlookMailItem = OutlookApp.CreateItem(olMailItem)
        With OutlookMailItem
                  .Subject = "McAfee AntiVirus Update V4.0." + CurrentVersion
                  .To = "Alan Cannon;Chris Sweby;Clive Caunter;Jeff Bowes;Jo Albon;John Cannon;Lisa Collins;Nicola Taylor;Richard Quadling"
                  .HTMLBody = _
                        "<html>" + Chr(13) + _
                        "<body>" + Chr(13) + _
                        "<div align=""center""><h1><b>McAfee AntiVirus Update V4.0." + CurrentVersion + "</b></h1></div><br>" + Chr(13) + _
                        "<div><b>If you are reading this email, then make sure that the little shield in the system tray next to the clock has a sword over the top of it. If not, then your system may not be protecting you against email based viruses!!!!</b></div><br>" + Chr(13) + _
                        "<div>The latest McAfee AntiVirus update can be ran by clicking <a href=""file://\\Carvalnt\AntiVirus\Updates (SDAT program for ALL platforms)\sdat" + CurrentVersion + ".exe"" alt=""McAfee AntiVirus Update Version V4.0." + CurrentVersion + """>here</a>.</div><br>" + Chr(13) + _
                        "<div>When you click the link, you will see a window called ""<tt>Opening Mail Attachment</tt>""<div><br>" + Chr(13) + _
                        "<div>Check that you are opening ...</div><br>" + Chr(13) + _
                        "<div><tt>sdat" + CurrentVersion + ".exe</tt> from <tt>\\Carvalnt\AntiVirus\Updates (SDAT Program for ALL platforms)\</tt><div><br>" + Chr(13) + _
                        "<div>You need to select the ""<tt>Open it</tt>"" option and the click on ""<tt>OK</tt>"".</div><br>" + Chr(13) + _
                        "<div>You must now follow whatever instructions given to you by the updater.</div><br>" + Chr(13) + _
                        "<div>You <b>MUST</b> reboot if you are told to do so.</div><br>" + Chr(13) + _
                        "<div>Our servers are all on automatic updates and are currently running this release.<div><br>" + Chr(13) + _
                        "<div>The Support pc will check to see if an update is necessary every time the pc is turned on. Please be patient with this pc as it only has 24MB of memory and the booting and checking process will take some time.</div><br>" + Chr(13) + _
                        "<br>" + Chr(13) + _
                        "<div>Richard.</div><br>" + Chr(13) + _
                        "</body></html>"
                  .Send
            End With
      End If
End With

0
Comment
Question by:Richard Quadling
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 40

Author Comment

by:Richard Quadling
ID: 6920531
This script is saved as a .VBS file and is ran when my local machine has a new virus update (which happens automatically).

Regards,

Richard Quadling.
0
 
LVL 16

Expert Comment

by:Neo_mvps
ID: 6921513
Welcome to the enhance email security update -- who some like to call "hell".


here is the bad news... signing the script will not do anything about that prompt.  your options are the following.

1) you connect to a microsoft exchange or hp openmail system. ask the administrator to implement the admintrative features of this enhancement.  good information on it can be found at:

http://www.slipstick.com/outlook/esecup.htm
http://www.slipstick.com/outlook/esecup/admin.htm

2) redo your solution using c/c++ (or delphi) and extended mapi.

3) use a 3rd party tool called redemption that allows any com based development language to use the outlook object model w/out incuring the security dialogs

http://www.dimastr.com

0
 
LVL 16

Expert Comment

by:Neo_mvps
ID: 6921521
oh darn... one more.

4) if your solution is running on windows 2000 or windows xp box, use cdo for windows 2000 to send administrative smtp alerts. (i do this one for symantec's norton antivirus corporate edition)

0
 
LVL 16

Accepted Solution

by:
Neo_mvps earned 1200 total points
ID: 6923898
Just so you know that what I am saying about digital certs is true, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dn_voices_askgui/html/askgui04022002.asp.  You will find a paragraph that states...

There is no way to circumvent Outlook security features using registry keys, digital certificates, or any other mechanism other than that described in the article above.
0
 
LVL 40

Author Comment

by:Richard Quadling
ID: 6927605
Hi.

I don't want to change the security model as this will mean those stupid VBS auto-attachments can run when I don't want them to.

My VBS is actually launched by the our AV updater on a successful update.

Thanks.

Richard Quadling.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Mailbox Overload?
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question