Thanks Tim Still too old fashioned I guess - Sometimes I just want an earthly being to answer my question :-)
Yes so the cmd line syntax is nircmd.exe win close class "CabinetWClass" Which closes all explorer windows. (not ideal) so there is another more specific syntax: nircmd.exe win close title "MyAppFolder" That is really it. As you said a copy of the nircmd should be included in the resources folder. Set path name to it and LEP. Very neat. Thanks for the tips. Now I need to see how this update process works on a Mac. There are some apple scripts that close finder windows. But will get there when I get there... On Fri, Nov 10, 2017 at 7:28 AM, Tim Nevels via 4D_Tech < [email protected]> wrote: > On Nov 9, 2017, at 2:00 PM, Sujit Shah wrote: > > > Sorry, I mean the original application folder. So if C:\4DAPP Folder is > > open in explorer the Update is not able to replace the files in that > > folder. > > I know exactly what you are talking about. The 4D updater script or batch > file is doing a rename or a delete on the folder and the Windows Explorer > has that folder locked because there is a window open to that folder. > > The solution is to just make sure that folder's window is closed before > you start the update process. While I have not done this exact thing, a > little Googling on "how to close a windows explorer window from command > prompt” provided some answers. > > It can be done, and there are several possible ways. Some work only on > older version of Windows. Some work if you have certain registry entries > set. Appears to be tricky and messy. > > http://www.msfn.org/board/topic/138301-how-to-close-a- > folder-through-cmdbat/ > https://stackoverflow.com/questions/24911112/close- > folders-window-with-batch-file > https://www.sevenforums.com/general-discussion/197707-how- > do-i-close-opened-folder-run-command-prompt.html > > From my very quick googling it appears the answer is a tool called > “nircmd.exe”. Execute this: nircmd.exe win close title "some window title” > > http://www.nirsoft.net/utils/nircmd.html > > Read the docs and spend some time in the Windows command prompt testing > this until you get it to work. Then you should be able to build a LEP > command line to make it happen from inside 4D. > > Of course you will now have to include the “nircmd.exe” so that it is > installed and available on the target Windows machine. It looks like you > don’t have to do a real install to make it work. It can just be included in > your “Resources” folder and you can execute it from there. > > That’s all I have to offer on this. Point you in a direction and see if > you can get it to work. > > I hope if you do get this to work you will post your results here so that > we can all benefit. > > One last point. Google is your friend. Don’t forget that just about every > Windows problem you run into somebody else has already dealt with it and > found a solution. So Google it and usually in minutes you will have a > possible solution or workaround. > > Tim > > ******************************************** > Tim Nevels > Innovative Solutions > 785-749-3444 > [email protected] > ******************************************** > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** > -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "There must be ingenuity as well as intention, strategy as well as strength. " ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

