• Keep AI Out of Your Microsoft Office – Modified

    Home » Forums » AskWoody support » Microsoft Office by version » Office 2019 for PC » Keep AI Out of Your Microsoft Office – Modified

    Author
    Topic
    #2663410

    Sorry in the delay responding to comments about this topic I started, but I’ve been traveling and away from my home network pcs to perform some testing.

    I want to thank Susan for posting the comments of Joshua Burkholder (MSFT) of January 1, 2023 about Office AI. My testing confirmed most of the comments with some differences as follows:

     The digital signature date on my ai.exe is January 26, 2024 (not December 16, 2022) and my ai.exe was last modified February 28, 2024.
     It was added to my system thru an update on March 4, 2024.
     There are two sets of Office AI files stored in separate folders for either the 32 bit or 64 bit install so if the primary ai.exe doesn’t load the secondary ai.exe will load. I have never seen Microsoft use this secondary install of the same app before. Microsoft wants to make sure the ai.exe runs. This is why renaming or deleting only one of the ai.exe files doesn’t stop the AI app from loading. However, if ai.dll is deleted from the primary folder with the ai.exe (as in my original command) it will prevent the secondary ai.exe from loading (requires the primary ai.dll to load any ai.exe file.
     On my system ai.exe loads when ever an Office app is opened and not when “needed” as Joshua stated and will stay open until that app is closed.
     An ai.exe will load for each Office app such as Word, Excel, Outlook, and PowerPoint; but will only load one ai.exe no matter how many documents are opened for that app. This may change when AI becomes functionable.
     Current ai.exe loads into the RAM, but does not use any CPU or further RAM use. It appears to load to RAM and when the RAM is full will push other app’s RAM to page file causing slowing in performance. Currently on nearly all systems this small amount of RAM usage will not cause any problems at all; however, on low end systems with minimum RAM this addition RAM load can cause performance issues which are corrected by preventing ai.exe from loading.
     Joshua did not reveal exactly what the Office AI app will do. I have extensively tested the Office apps with ai.exe removed and found all previous functions of these apps to work as they always did. I can only speculate that the AI function will be one that is not currently part of the Office apps. I guess we will find out when Microsoft turns the AI function on.
    Opinion:
    Since Microsoft created a separate process to avoid placing to much resource requirements on the Office app I think that the resource requirements (CPU and RAM) of ai.exe when turned on will be so high that many users with less robust systems will see a performance hit and will seek a way to prevent Office AI from running.

    I rewrote the command to delete ai.exe and ai.dll files from both folders of either a typical click-to-run 32 bit or 64 bit install. This one bat file will work for either setup. I chose to delete rather than rename because the process will need to be repeated after every Office update (Microsoft wants to make sure the ai files are there) and renaming would build up too many renamed ai files. If you desire to have ai start working again, stop running the bat file and the files will be replaced on the next update (or sooner).

    Besides the Modified PDF instructions for deleting the ai files, I also uploaded the bat file for those that wish to download the bat file rather than create it.

    Keep-AI-Out-of-Your-Microsoft-Office-Modified

    NoAI

    HTH, Dana:))

    • This topic was modified 1 year, 1 month ago by Drcard:)).
    • This topic was modified 1 year, 1 month ago by Drcard:)).
    1 user thanked author for this post.
    Viewing 14 reply threads
    Author
    Replies
    • #2663848

      DCard,

      Thanks for your work on this topic!

      I’ve been working on a PowerShell script to move these files to a User Directory and then provide the capability to restore them back if desired.

      I have it mostly working but I have a question. The ai.exe and ai.dll files in the respective ProgramFilesCommonX86 and ProgramFilesCommonX64 directory paths are of different sizes. I therefore don’t understand how if you delete the one for say X64 the system could “fall back” to the X86 version?

      If you, or anyone else, knows the answer I’d appreciate the explanation before I make major updates to handle the second directory.

      On a side note all three of my machines are running X64 Office 365. However, the directory structure still shows an entry for Office15. Is this trash that can be removed or is it necessary?

      Inquiring minds want to know…

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #2663882

      The ai.exe and ai.dll files in the respective ProgramFilesCommonX86 and ProgramFilesCommonX64 directory paths are of different sizes. I therefore don’t understand how if you delete the one for say X64 the system could “fall back” to the X86 version?

      All my systems are running the 32 bit click to run version of Office. The ai.exe in the ProgramFileszCommonx86 and ProgramFilesCommonx64 directories for the 32 bit install are the same exact file (size and version). In my testing I used these ai.exe files and did interchange them between their original directory and both would function as primary and secondary. Secondary ai.exe would not load if ai.exe and ai.dll in the primary folder was missing.

      I don’t know if the same applies to the 64 bit versions. Open the Properties of each ai.exe file. Check the Details tab to see if they have the same file version number and modification date.

      On a side note all three of my machines are running X64 Office 365. However, the directory structure still shows an entry for Office15. Is this trash that can be removed or is it necessary?

      Sorry, I do not know.

      HTH, Dana:))

      1 user thanked author for this post.
    • #2663913

      Dana,

      Here’s the comparison X86 on left X64 on right.
      AI-exe-x86-x64-Vers-Size

      Version numbers match but file size doesn’t???

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #2663945

      Hey Y’all,

      As to the question of the Microsoft Office 15 directory I tested this on “Canary” by searching the Registry first with NO entries found. Then I moved the directory to another drive and tested my O365 applications and all appear to be working normally.

      I then did the same for my daily driver with the same results.

      I’ll report back if any anomalies appear but if you don’t hear further on this topic you can assume it was a leftover directory from an earlier time.

      FYI: There is only one sub-directory with only 2 files in the directory.
      integratedOffice.exe
      OfficeClickToRun.exe

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #2664409

        Hey Y’all,

        Ok I finally have the PS script done. I was really getting confused by MS directory structure but finally got it figured out thanks to Dana’s earlier posts.

        The program will move the two files ai.exe and ai.dll to files in your Documents folder. The program will give you messages to tell you where. You can run the program with the -Revert switch to move the files back to their original locations. The program cleans up after it self by deleting the folders where the files were stored from your documents folder. You can read the Comment Based Help file by either editing the file or from PowerShell enter:
        Get-Help d:\path\Remove-OfficeAI.ps1 -Full

        You can download the script Remove-OfficeAI.ps1 in a .zip file from my Shared OneDrive folder.

        I’ve tested this on my three machines but unfortunately they are all 64Bit Office 365 installations. Although 2 are Win 11 and one is Win 10.

        Before trying this out PLEASE IMAGE YOUR C: Drive or where ever you have OFFICE installed!

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

    • #2664410

      How often will users need to run it?

      After Patch Tuesday updates? sfc /SCANNOW? DISM RestoreHealth?

       

    • #2664507

      ONG, as Dana stated in OP probably after every update Tues.
      Ths script is designed to allow the user to remove/restore as desired.

      DISM is for the OS not Office AFAIK.

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #2664647

      DISM is for the OS not Office AFAIK.

      ai.exe probably has dependencies on OS files.

      You might run a dependency checker on it and see…

      https://github.com/lucasg/Dependencies

      This one is a re-write of the old “Dependency Walker”.

      1 user thanked author for this post.
    • #2664722

      Probably would be less work overall to use Group Policy…

      Computer Configuration > Windows Settings > Security Settings > Software Restriction Policies > Additional Rules > New Path Rule

      Browse to the path and executable name, select Disallowed, and Apply.

      It will persist between updates, so nothing needs to be run.

       

      • #2664843

        Probably would be less work overall to use Group Policy…

        Computer Configuration > Windows Settings > Security Settings > Software Restriction Policies > Additional Rules > New Path Rule

        Browse to the path and executable name, select Disallowed, and Apply.

        It will persist between updates, so nothing needs to be run.

        Have you tried this? It doesn’t work. The policy generates new keys in the Registry

        HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun with a value of ai.exe

        BUT this policy/Registry value will not stop AI from loading even if the policy is made to both primary and secondary ai.exe. It appears that Microsoft has found a way to by pass the Group Policy Editor and Registry values and maybe a reason why there is a primary and secondary of the same files. I had tried the Registry method before trying moving/renaming/deleting method and found the deletion works, the easiest, and a set and forget method. Microsoft will update more often than you will want to deal with it, so IMO a bat file ran by Task Scheduler totally takes care of the problem and I can forget about it.

        HTH, Dana:))

    • #2664731

      You might run a dependency checker on it and see… https://github.com/lucasg/Dependencies

      Hi OldNavyGuy:

      Thanks for that link. I used the legacy Dependency Walker (Windows 95 to Win 8.x) on my old Vista SP2 machine and didn’t realize someone had created a similar tool called Dependencies for newer operating systems.
      ———
      Dell Inspiron 15 5584 * 64-bit Win 10 Pro v22H2 build 19045.4291 * Firefox v125.0.2 * Microsoft Edge v124.0.2478.67 * Microsoft Defender v4.18.24030.9-1.1.24030.4 * Malwarebytes Premium v5.1.3.110-1.0.1219 * Macrium Reflect Free v8.0.7783

    • #2665114

      Have you tried this? It doesn’t work. The policy generates new keys in the Registry

      HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun with a value of ai.exe

      That’s a registry hack from the Windows 7 days…

      https://www.howtogeek.com/8739/restrict-users-to-run-only-specified-programs-in-windows-7/

      Depends on your target audience…

      GPO in Windows 10 Pro uses Software Restriction Policies Path Rules.

      I use it to restrict a few registry keys and executables.

      The rules persist between updates.

      A simpler way of doing it for the end user…if you have GPO.

       

       

    • #2665397

      That’s a registry hack from the Windows 7 days… https://www.howtogeek.com/8739/restrict-users-to-run-only-specified-programs-in-windows-7/ Depends on your target audience… GPO in Windows 10 Pro uses Software Restriction Policies Path Rules. I use it to restrict a few registry keys and executables. The rules persist between updates. A simpler way of doing it for the end user…if you have GPO.

      Yes, that is an old hack that still works in Windows 10 for most .exe programs. That registry hack doesn’t stop ai.exe and I discovered why….ai.exe is not launched from Explorer but rather thru the system as an add on process so an Explorer policy will not apply.

      I am still would like to know if the GPO Software Restriction Software Policy Path rule for ai.exe prevents ai.exe from loading and if so, what Registry entries that rule makes. I do not know if a GPO policy can prevent a system launched process from launching or if a command line can override the software restriction.

      HTH, Dana:))

    • #2665466

      I do not know if a GPO policy can prevent a system launched process from launching or if a command line can override the software restriction.

      Working with path rules

      HTH

      • #2665513

        Thanks for the reply and the link. I have ready read that info and know how to create a GPO Software Restriction Software Policy Path rule and what it supposed to do. I have also read at other sites that a GPO Software Restriction Software Policy Path rule will not stop an app that is opened with a system command. Since ai.exe is a system initiated app I wanted someone with a fully functioning GPO and MS Office to actually test and see if a GPO Software Restriction Software Policy Path rule will prevent ai.exe from running when an Office app is opened.

        HTH, Dana:))

    • #2665538

      I have also read at other sites that a GPO Software Restriction Software Policy Path rule will not stop an app that is opened with a system command.

      I’m skeptical, but I would be interested in seeing your sources.

      I set up a Path Rule to block smartscreen.exe in C:\Windows\System32, and an Event ID 866 recorded the block…

      Access to C:\Windows\System32\smartscreen.exe has been restricted by your Administrator by location with policy rule {f33fa755-b7da-4d00-831f-67aaa51807d3} placed on path C:\Windows\System32\smartscreen.exe.

      I expanded the Processes list in Task Manager, and didn’t see it running.

      Also didn’t see it in Sysinternals Process Explorer.

      I don’t use Office, and if you don’t have a working GPO, I’m sure there are some Win 10/11 Pro users here that would be willing to test ai.exe for you.

       

       

    • #2665663

      Thanks for your efforts.

      I’m skeptical

      Me too.  That’s why I wanted someone with GPO and Office to test it.

      This is just one of many links I found where a poster claimed that GPO Software Restriction Policy did not work for ai.exe.

      I’ve tried with GPOs by adding a “Disallow” rule through “Computer Configuration>Windows Settings>Software Restriction Policies” but process still shows up.

      At this site: Outlook + AI.EXE – How not to?

      Other posters go on to explain that since ai.exe is started from an Office app (system started) the policy will not work since the system started it as a service or scheduled task.

      I have read other such posting where a user has tried the GPO policy way to stop ai.exe and reported that it did not work. Hence my original statement that a GPO policy for ai.exe does not work, but would like someone I know who will set the GPO policy up right and confirm that it doesn’t work so readers of these posts don’t try something that doesn’t work.

      HTH, Dana:))

    • #2665864

      the policy will not work since the system started it as a service or scheduled task.

      Seems like that premise would apply to smartscreen.exe as well…

      However, it worked.

      We’ll see what happens.

       

       

       

    Viewing 14 reply threads
    Reply To: Keep AI Out of Your Microsoft Office – Modified

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: