Jump to content

Recommended Posts

Posted

I have a script that opens some Excel books that  are stored in SharePoint .  Without getting to much into detail as its a very long story I have to open Internet Explorer to the SP site in order for all of this crap to work. 

 

Anyway I have a bit of code in my script that i found via google-fu

$ieList = ProcessList("iexplore.exe")
If IsArray($ieList) Then
   For $I = 1 To Ubound($ieList) -1
      ProcessWaitClose($ieList[$I][1])
   Next
EndIf

Exit

Now on Windows 7 this bit works great.  On Windows Server 2012 R2 where this things runs is another story.  I need to be able to force close all instances of Internet explorer that are running as part of my code. 

 

Any help is appreciated. 

Posted

The code doesn't cause any errors or the whole script to not run.  It just doesn't work.  Internet Explorer still stays open. 

Posted (edited)

does this powershell comman work at least on your instance of Server 2012?

get-process iexplore | stop-process

and if not, why not is the question. IE doing something in the background?

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Posted
  On 5/10/2018 at 1:32 PM, seryth said:

The code doesn't cause any errors or the whole script to not run.  It just doesn't work.  Internet Explorer still stays open. 

Expand  

And will stay as long as somebody close them.

As your openning AU3 snippet, is only watching if IE is already closed.


https://www.autoitscript.com/autoit3/docs/functions/ProcessWaitClose.htm

  Quote

Pauses script execution until a given process does not exist.

Expand  

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...