0

I have an unattended PC which does a very simple task : read emails from a POP server and run various tasks based the content of those emails... 24/7/365

The problem is that at least once a week "something" glitches and the processing stalls because Outlook is waiting for a user to confirm their password with the dreaded Enter Network Password dialog.

I have read so many articles in the past 6 months in an attempt to fix the root cause and nothing has worked. There's no WiFi involved and the email server is Google so it should be extremely reliable so I can only suspect that the broadband connection to my ISP is the culprit as I've read that "certain network conditions" can trigger the password prompt.

Jamie Garroch - MVP
  • 2,839
  • 2
  • 16
  • 24

2 Answers2

0

Yesterday, I gave up on the root cause approach and looked for an automated tool to cancel the annoying dialogue box when it appears. To my surprise, Windows can do this out-of-the-box via Windows Script Host. Here's how:

A. Open your preferred text editor.

B. Copy paste the following VB Script (you can also use JScript if you prefer but I'm not including the syntax here).

Set WshShell = WScript.CreateObject("WScript.Shell")
' Move focus to the network password dialog if it exists (if not, script continues)
If WshShell.AppActivate ("Enter Network Password") = True Then
  ' Suspend the script for 1/10th second to make sure the dialogue is in focus
  WScript.Sleep 100
  WshShell.SendKeys "{ESC}"
  ' Optionally save this event to a log file
  Const ForReading = 1, ForWriting = 2, ForAppending = 8
  Dim fso, file
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set file = fso.OpenTextFile("C:\Temp", ForAppending, tristateFalse)
  file.Write vbCrLf & Date & " " & Time
  file.Close
End If
Set WshShell = Nothing

C. Save the file with a .vbs extension e.g. EscapePrompt.vbs

D. Next, open the Windows Task Scheduler (Click the Windows Start button and type "Task" and you should see Task Schedule appear at the top of the search result list, or just type "Task" from the Windows 8 tile view).

Create a new task that runs the script file above, every day, repeating every 5 minutes, indefinitely:

  1. General tab : give the task a name and then check Run with highest privileges
  2. New Trigger tab : click New and select Daily and then in the Advanced Settings, check Repeat task every: and choose 5 minutes. set the for a duration of: to Indefinitely. Check Enabled
  3. Actions Tab : click New and then Browse to choose the script file you created above.
  4. Conditions tab : Set any conditions as required by your environment.
  5. Settings tab : I don't change anything here but you may want to.

Now, when the Enter Network Password prompt appears, there is a maximum delay of 5 minutes before it is automatically cancelled.

For more information on WScript and in particular, the SendKeys method, check out MSDN : http://msdn.microsoft.com/en-us/library/8c6yea83(v=vs.84).aspx

You may also be interested in our free VBA examples at: http://youpresent.biz/category/blog/vba/

Jamie Garroch - MVP
  • 2,839
  • 2
  • 16
  • 24
0

Microsoft outlook keeps prompting network password if there registry value and network password mismatches. If you change the password for your account in ISP or Control Panel.Then, configure and login outlook with the new password.Then ,it will not prompt for outlook password again and again.

Anands23
  • 758
  • 9
  • 19