Running Outlook Express With Task Sheduler

D

Doug`

Would anyone be able to tell me the appropriate way of
setting up the Windows XP task scheduler to run Outlook
Express to check email? I have it setup but it seems that
when I receive large email messages either the standbye
mode takes effect and puts OE to sleep before it has
finished downloading, or; in other cases the task
scheduler, as I have to set to stop the program after 5
minutes, shuts OE down before it is able to finish
downloading all messages. I have tried everything to
resolve this including setting it up with different
intervals and end times. Could it be that OE is not meant
to be run by the task schedualer? Maybe someone here has
the know how to write an initialization string that I can
use in the advanced properties of the schedualers wizard,
maybe a string that would just run the procedure of
checking the mail and it would close when all mail is
downloaded. If you are to demonstrate this on your own
you will know exactly what I am trying to explain. Thanks
in advance for your efforts and please, if possible, reply
to my email address (e-mail address removed), after
posting in the past I can never find my topic, always
seems to get nudged back by others. OK Thanks! Doug
 
J

Jon

Remove your 5 minute setting then.......

In Outlook Express

Tools > Options > Connection > Check "Hang up after sending and receiving"

Jon
 
D

Doug

-----Original Message-----
Would anyone be able to tell me the appropriate way of
setting up the Windows XP task scheduler to run Outlook
Express to check email? I have it setup but it seems that
when I receive large email messages either the standbye
mode takes effect and puts OE to sleep before it has
finished downloading, or; in other cases the task
scheduler, as I have to set to stop the program after 5
minutes, shuts OE down before it is able to finish
downloading all messages. I have tried everything to
resolve this including setting it up with different
intervals and end times. Could it be that OE is not meant
to be run by the task schedualer? Maybe someone here has
the know how to write an initialization string that I can
use in the advanced properties of the schedualers wizard,
maybe a string that would just run the procedure of
checking the mail and it would close when all mail is
downloaded. If you are to demonstrate this on your own
you will know exactly what I am trying to explain. Thanks
in advance for your efforts and please, if possible, reply
to my email address (e-mail address removed), after
posting in the past I can never find my topic, always
seems to get nudged back by others. OK Thanks! Doug

.
In that case what would terminate the OE program after
all mail has been downloaded?
 
L

Lanwench [MVP - Exchange]

Hi - I don't know that you can do what you want, but the folks in the OE
newsgroups are the right ones to ask.

Try posting in one of these newsgroups:
microsoft.public.windows.inetexplorer.ie5.outlookexpress for OE 5.x
microsoft.public.windows.inetexplorer.ie55.outlookexpress for OE 5.5x
microsoft.public.windows.inetexplorer.ie6_outlookexpress for OE 6.x
microsoft.public.internet.outlookexpress.mac for OE for Macintosh

If those groups aren't carried on the news server that's carrying this group
try using msnews.microsoft.com (MS's public news server that's the source
for all the microsoft.public newsgroups).

If you're accessing the Microsoft newsgroups through the MS Product Support
Services Community Newsgroups web interface, click
http://communities.microsoft.com/newsgroups/default.asp?icp=InternetExplorer
to get to the Internet Explorer groups, then click the plus sign next to
your version of IE to see the link to the Outlook Express group for that
version number.

A good website for information on OE is:
http://www.tomsterdam.com/


Sorry, no email replies - ask in the group, read the answer in the group.
Also note - posting your valid e-mail address in a newsgroup post, or in
your news account settings, is a surefire way to get spam and SWEN and other
viruses sent to you....see http://www.mailmsg.com/SPAM_munging.htm for help
in the future, but note that now that your address is out there, there's not
much you can do other than changing your address.
 
J

Jon

The way to go is to have an external program start your Outlook Express (eg
a script written in vbscript), and then schedule this program rather than
Outlook Express.
This would then also test whether you are connected to the internet or not,
and finish Outlook Express accordingly

Ingredients for the program.........

A reliable way of connecting to the internet ..eg use of RASDIAL (type
rasdial /? at command prompt for syntax).( (Better is the use of API calls
using the "InternetAutodial" function in "wininet.dll", but RASDIAL will
do))

Ensure Outlook Express is not in Offline Mode via this registry setting
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings
GlobalUserOffline = 0

Check the connection by retrieving your own ip address (eg via
ipconfig.exe )and if it's non-blank then that can be an indicator of being
connected or not

Use WMI to end Outlook Express via script or some other method, once not
connected to the internet


Jon
 
D

Doug

-----Original Message-----
The way to go is to have an external program start your Outlook Express (eg
a script written in vbscript), and then schedule this program rather than
Outlook Express.
This would then also test whether you are connected to the internet or not,
and finish Outlook Express accordingly

Ingredients for the program.........

A reliable way of connecting to the internet ..eg use of RASDIAL (type
rasdial /? at command prompt for syntax).( (Better is the use of API calls
using the "InternetAutodial" function in "wininet.dll", but RASDIAL will
do))

Ensure Outlook Express is not in Offline Mode via this registry setting
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersio n\Internet
Settings
GlobalUserOffline = 0

Check the connection by retrieving your own ip address (eg via
ipconfig.exe )and if it's non-blank then that can be an indicator of being
connected or not

Use WMI to end Outlook Express via script or some other method, once not
connected to the internet


Jon






.
OK then what would put my computer on standbye and wake
it so that I dont have to have it running in full mode all
the time?
 
D

Doug

-----Original Message-----
Remove your 5 minute setting then.......

In Outlook Express

Tools > Options > Connection > Check "Hang up after sending and receiving"

Jon





.
I think removing the 5 minute setting might just be the
trick! lets see what happens...
Thanks for replying!
Doug
 
D

Doug

-----Original Message-----
The way to go is to have an external program start your Outlook Express (eg
a script written in vbscript), and then schedule this program rather than
Outlook Express.
This would then also test whether you are connected to the internet or not,
and finish Outlook Express accordingly

Ingredients for the program.........

A reliable way of connecting to the internet ..eg use of RASDIAL (type
rasdial /? at command prompt for syntax).( (Better is the use of API calls
using the "InternetAutodial" function in "wininet.dll", but RASDIAL will
do))

Ensure Outlook Express is not in Offline Mode via this registry setting
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersio n\Internet
Settings
GlobalUserOffline = 0

Check the connection by retrieving your own ip address (eg via
ipconfig.exe )and if it's non-blank then that can be an indicator of being
connected or not

Use WMI to end Outlook Express via script or some other method, once not
connected to the internet


Jon






.
I am still vague though, about using the dos commands, I
very seldom use them and dont have much experience with
them, so therefore, if you have the patience, I would need
you to write step by step instructions for running OE to
check mail, shut down and put my computer in standbye mode.
 
J

Jon

Well perhaps try this first to see if it fits your needs, before the more
complex route.....

Schedule Outlook Express as previously, checking the "hang up after sending
and receiving" box

Try the following options in Power Management....

Adjust via Control Panel > Power Options
(or Control Panel > Performance and maintenance > Power Options)

(1) Turning the monitor off after 5 minutes, since it's the monitor that
consumes most power anyway
(2) Setting the computer to go into standby after 20 minutes of idleness
(increase if you get longer downloads regularly)
(3) Computer into hibernation after 6 hours
(4) Turn off hard disks = never

Choose your options on the "Power Schemes" tab and save the scheme on the
same tab, giving a name
And on the advanced tab in "Power Schemes" check the "always show icon in
taskbar", so you can right-click it and change options easily when you want
to

(And within the task properties in Task Scheduler check the "Wake the
computer to run this task" , which you've probably already discovered)



Jon
 
J

Jon

The following script should hopefully do the trick

Paste all the lines into notepad
On the "DialUpName" line put the EXACT name of your dialup connection as it
appears in Network Connections
On the next line put your isp username and password separated by a space
Save the file with a .VBS extension (eg "OutlookExpress.vbs") and then click
on it to test it.
If it works ok then schedule it using Task Scheduler
If you want to tweak the program ever then it's written in vbscript, and the
comments will hopefully give you a guide
to what the lines do too.

Hope it works ok

Jon





'Connect to the internet
DialUpName = "Exact name of your dialup account as it appears in Network
Connections"
Authentication = " " & "your_isp_username your_isp_password"


Set WshShell = WScript.CreateObject("WScript.Shell")
hidden = 0
'Remove the word hidden on the next line if you want to see the dialup
progress
wshshell.run "rasdial " & """" & DialUpName & """" & Authentication , hidden
, true


'Object used to determine if online or not
set ipfinder = createobject("rcbdyctl.setting")

'Ensure Outlook Express not in offline mode
wshshell.regwrite _
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline", _
0,"REG_DWORD"



'Run Outlook Express
wshshell.run "C:\PROGRA~1\OUTLOO~1\msimn.exe"



'Wait for the connection to terminate (after sending and receiving)
'Check connection every 10 seconds for a maximum of 20 minutes

counter = 6 * 20 'The 20 here corresponds to the 20 minutes of checking
the connection, so can be altered if necessary
do while online = true
counter = counter - 1
wscript.sleep 10000
if counter = 0 then exit do
loop



'End Outlook Express
EndOutlookexpress



'If still online then disconnect from internet
if online then
wscript.sleep 2000 'Pause to allow Outlook Express to close
wshshell.run "rasdial " & """" & DialUpName & """" & " /disconnect" ,
hidden , true

end if

'Go into standby mode
standby


'Function that checks whether the computer is online or not

Function online

online = false
ipaddress = ipfinder.GetIPAddress
if len(trim(ipaddress))<>0 then online = true

end function


'Routine that closes Outlook Express

Private sub EndOutlookExpress

Set Wmi = GetObject("winmgmts:")
Wmiq = "select * from Win32_Process where name='msimn.exe'"
Set QResult = Wmi.Execquery(Wmiq)

If QResult.Count > 0 Then
For Each oProcess In QResult
iRet = oProcess.Terminate(1)
Next
End If

end sub



Public sub Standby

'Use shell.application functions to go into standby mode
set shellapp = createobject("shell.application")

shellapp.shutdownwindows
wscript.sleep 5000
wshshell.sendkeys "s"


end sub
 
D

Douglas Pounder

OK, so far this seems to be working out, the only thing though, I have no
idea except for inserting my server infor into that notepad document, what
all that language is. What should I do about OE settings? currently, I
have OE options set to hang up when finished and to send/rec at OE startup,
I aslo have the Task Schedualer set to run every hour for 24 hours daily,
will either of these settings conflict with the script? I have noticed that
when running it from the TS as a one time, it sends my pc into standby mode
which is what I want it to do anyway, but will it wait for all my messages
large or small to download before going into standbye, the initial problem
with setting it up with TS Wizard was that I would have to set a standby
mode for it to go into standby to save energy but if the emails were large
and took longer than the activate standby mode it would hang OE and keep the
computer running and the connection to the internet, I hope I am explaining
this OK, that is why I suggested in the original posting to do a self
experiment because it is too complicated and mind boggling to comprhend in
explaination, lets suppose this scenario: I want my computer to wake from my
10 minute standby mode to open OE and check and download all mail until
finished downloading then close OE and allow computer to go back into
standby mode. What I guess I am not understanding is if with your script,
do I have to manually configure the standby mode and the OE options? or is
it already written into your script? Sorry for the drawn out question.
Sure wish I knew codes and how to write script there are many other things
that I would like my computer to perform on an automated basis, after all
isn't that what computers are for? What I cant understand is why there is a
WinXP Task Scheduling wizard that offers a list of available programs to
schedule but none are really executable, because when you actually open a
program you usually have to initiate something for it to do? this has
me.... Anyway, thanks again for all your time and patience! Doug
 
D

Doug

FYI I have attached a reply from another member that includes the script for
doint so. Thanks! Doug
"Lanwench [MVP - Exchange]"
 
J

Jon

The script doesn't make any changes to your Outlook Express settings or your
Power Options settings.
(except for making sure Outlook Express is not in offline mode).

For it to work properly, however, you need those 2 settings you mentioned in
Outlook Express
ie
- OE to hang up when finished sending and receiving
- OE to Send and receive at startup


The script should send your computer into standby after sending and
receiving,
independently of your "Power Options" settings for standby.
eg you could set "System standby" to "never" in Power Options and it should
still go into standby after sending and receiving


Should be able to schedule it every hour, or whenever you want.


The script currently allows OE to run for a maximum of 20 minutes after
which it will close it down and disconnect from the internet automatically,
and then go into standby. So it shouldn't hang.
This is necessary, since there may also be error messages in Outlook Express
eg problems connecting to mailboxes etc

If you want to increase / decrease that number of minutes eg to allow for
large downloads or to save energy,then.....
Look for the line that says "Counter = 6 * 20" .. change the 20 to the
maximum number of minutes you want to allow it to run


To be able to tweak the program further, because yes it is quite complex,
and after a while you may want to change a few things, it may be worth your
while to learn the basics of
"Windows Script Host" and vbscript. Search on Google for some starter
tutorials or get a book from your local bookshop / library. This would also
help you to do similar things with other programs that you've got on your
machine.

Hope I've answered your questions

Jon
 
D

Douglas Pounder

Does that mean it wont shut down after 20 minutes even though the messages
completed download after 5 minutes does it run for the entire 20 minutes?
 
J

Jon

No if it downloads the messages in 5 minutes it will end after 5 minutes. 20
minutes is just a maximum.
Jon
 
D

Douglas Pounder

Excellent!!!! you made my day/night! I haven't been offline long enough
for it to run on it's own but I'm hopeful.
Doug
 
D

Doug

Hello Jon

After monitoring the response of my TS running OE with the Script you have written for the group, I been noticing that, with close observation, that it is not running properly, what seems to happen is that it wakes my pc from standby mode, then runs the TS with the script but just as it attemps to connect to the internet it stops, I have detected this by watching it and with my external modem I can see it's activity and what is happening is, it attempts to dial then stops and my pc returns to standby mode. I have fiddled withnumerous combinations of TS settings for this task, before resorting to having to trouble with further solution, and nothing seems to give my guess would be that the script is doing what either the TS script or OE is already configured to do, but I know nothing about the way the script was written except for where you had asked me to place my IP address and password, whch I have succeeded. Would you at your next conveneice, have another look at the scrip? it would be greatly appreciated, and dreaded to think after coming this far with it that it turns out to be useless. Thanks for all you time, patience and continued support! Sincerely, Douglas Pounder Newport, RI
 
J

Jon

I'll give you a fuller response this evening or tomorrow when I'm less busy, but the short answer is it sounds like you're not entering the correct information (or the information correctly) for your username (not your ip address) and password. I'll write a bit later.

Jon
Hello Jon

After monitoring the response of my TS running OE with the Script you have written for the group, I been noticing that, with close observation, that it is not running properly, what seems to happen is that it wakes my pc from standby mode, then runs the TS with the script but just as it attemps to connect to the internet it stops, I have detected this by watching it and with my external modem I can see it's activity and what is happening is, it attempts to dial then stops and my pc returns to standby mode. I have fiddled withnumerous combinations of TS settings for this task, before resorting to having to trouble with further solution, and nothing seems to give my guess would be that the script is doing what either the TS script or OE is already configured to do, but I know nothing about the way the script was written except for where you had asked me to place my IP address and password, whch I have succeeded. Would you at your next conveneice, have another look at the scrip? it would be greatly appreciated, and dreaded to think after coming this far with it that it turns out to be useless. Thanks for all you time, patience and continued support! Sincerely, Douglas Pounder Newport, RI
 
J

Jon

Ok the fact that your modem starts to dial suggests that you have entered the name of the connection correctly. However, what you should be entering for the username and password is the username and password that you got given when you signed up for internet access (with usadatanet or whoever provides you with internet access).

You can test the information and look at the error messages that your dialup produces by perhaps taking a step back and trying the following..

start > run > cmd

rasdial "exact name of your connection in quotes" username password

(replace "exact name of your connection in quotes" and username and password in the above line with what you entered in the script. The username and password in the above line are not in quotes, unlike the name of the connection)

If the information is entered correctly that should connect you to the internet. If not look at the error messages produced.

Once you've managed to get that command to work correctly, then return to your script and enter the correct information as outlined previously.

Hope this helps

Jon



Hello Jon

After monitoring the response of my TS running OE with the Script you have written for the group, I been noticing that, with close observation, that it is not running properly, what seems to happen is that it wakes my pc from standby mode, then runs the TS with the script but just as it attemps to connect to the internet it stops, I have detected this by watching it and with my external modem I can see it's activity and what is happening is, it attempts to dial then stops and my pc returns to standby mode. I have fiddled withnumerous combinations of TS settings for this task, before resorting to having to trouble with further solution, and nothing seems to give my guess would be that the script is doing what either the TS script or OE is already configured to do, but I know nothing about the way the script was written except for where you had asked me to place my IP address and password, whch I have succeeded. Would you at your next conveneice, have another look at the scrip? it would be greatly appreciated, and dreaded to think after coming this far with it that it turns out to be useless. Thanks for all you time, patience and continued support! Sincerely, Douglas Pounder Newport, RI
 
D

Douglas

I have the isp and password entered correctly, the modem intiates but does not dial, then the system goes into standby mode. Do you think that instead of the scrip just running the OE program itself, that maybe in the script is just executing OE then going to the next step in the script which is to check for a coonection then go into standby mode? it would seem to me that the script is running through but without the full execution of the OE program, after all the TS is telling the script that is only asking to run OE and maybe it thinks that that is all it has to do before going to the next step in the script, maybe the the script should be written to in include each desired function of OE before continuing to the next step? Sometimes two brains are better than one, especially with complex situations like this, you would've thought by now with this XP Edition that MS would have put enough thought into writing the program to have OE options to run from standby with it's own scheduler, I don't see why they even bothered to have a task scheduler, most things that you would want to schedule require more than just the ..exe file to perform given funtions, i.e. Disk Cleanup, once this program is executed it requires further questions on the part of the user such as what files to cleanup and addtional options, how would this be possible just by having the TS run the Disk Cleanup. Am I wrong or were computers only manufactuered and retail shelved for computer language literate people? OK, well that is my observation on the matter. HAVE A GOOD 4TH WEEKEND!
Doug,
Newport, RI
Ok the fact that your modem starts to dial suggests that you have entered the name of the connection correctly. However, what you should be entering for the username and password is the username and password that you got given when you signed up for internet access (with usadatanet or whoever provides you with internet access).

You can test the information and look at the error messages that your dialup produces by perhaps taking a step back and trying the following..

start > run > cmd

rasdial "exact name of your connection in quotes" username password

(replace "exact name of your connection in quotes" and username and password in the above line with what you entered in the script. The username and password in the above line are not in quotes, unlike the name of the connection)

If the information is entered correctly that should connect you to the internet. If not look at the error messages produced.

Once you've managed to get that command to work correctly, then return to your script and enter the correct information as outlined previously.

Hope this helps

Jon



Hello Jon

After monitoring the response of my TS running OE with the Script you have written for the group, I been noticing that, with close observation, that it is not running properly, what seems to happen is that it wakes my pc from standby mode, then runs the TS with the script but just as it attemps to connect to the internet it stops, I have detected this by watching it and with my external modem I can see it's activity and what is happening is, it attempts to dial then stops and my pc returns to standby mode. I have fiddled withnumerous combinations of TS settings for this task, before resorting to having to trouble with further solution, and nothing seems to give my guess would be that the script is doing what either the TS script or OE is already configured to do, but I know nothing about the way the script was written except for where you had asked me to place my IP address and password, whch I have succeeded. Would you at your next conveneice, have another look at the scrip? it would be greatly appreciated, and dreaded to think after coming this far with it that it turns out to be useless. Thanks for all you time, patience and continued support! Sincerely, Douglas Pounder Newport, RI


Jon said:
Word wrap got in the way with that pasting so have attached file

Right-click it and choose edit to view


Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top