Scheduled Task problem

  • Thread starter Thread starter NickC
  • Start date Start date
N

NickC

I am using Windows XP.
I am having an annoying problem with Scheduled Task. I have scheduled
Outlook to run at these times: 1) Specified time such as 6 AM and 2) at
logon

How do I arrange it so that if the program is already running, a second
instance of the program will not start. For example if I log on at 5 AM and
the program is started. At 6 AM I would not require it to start again since
it is already running. I do not see that option in Windows XP. I thought
Windows 98 had this feature
 
You may use this VBScript and schedule it to launch Outlook.exe. Copy the
following code to Notepad, and save the file as "launch.vbs". Schedule this
..vbs to run.

----------------------------
Set WshShell = WScript.CreateObject("WScript.Shell")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name = 'outlook.exe'")
If colProcesses.Count = 0 Then
WshShell.Run chr(34) & _
"%Programfiles%\Microsoft Office\Office10\Outlook.exe" & Chr(34)
End If
----------------------------

If Outlook.exe is already running, the script does nothing.

--
Ramesh, Microsoft MVP
Windows XP Shell/User

Windows XP Troubleshooting
http://www.winhelponline.com
 
Also make a note of the default installation path for Microsoft Office /
Outlook. Choose your version accordingly:

OL98 and OL2000
%Programfiles%\Microsoft Office\Office\outlook.exe

OL2002
%Programfiles%\Microsoft Office\Office10\Outlook.exe

OL2003
%Programfiles%\Microsoft Office\Office11\Outlook.exe

--
Ramesh, Microsoft MVP
Windows XP Shell/User

Windows XP Troubleshooting
http://www.winhelponline.com
 
Back
Top