I need a simple script to initiate whenever Word 2016 closes

Page 1 of 2 12 LastLast

  1. Posts : 83
    Windows 10 Pro TH2
       #1

    I need a simple script to initiate whenever Word 2016 closes


    Good morning guys,

    I want some help from you guys as you can tell from the title I need a simple .bat or any type of script that initiate my .reg
    file on my desktop when my Microsoft word 2016 closes

    and this should happen without any dialogues boxes simply means I don't want any interruptions from any dialogues boxes asking for user permission it should happen silently.

    Thanx guys for reading my request :)
      My Computer


  2. Posts : 13,898
    Win10 Version 22H2 Pro and Home, Win11 Pro and Home
       #2

    Just a question: Does that mean you want no prompts as to saving or discarding a new document, changes to an existing document or template when you close Word?
      My Computers


  3. Posts : 83
    Windows 10 Pro TH2
    Thread Starter
       #3

    Berton said:
    Just a question: Does that mean you want no prompts as to saving or discarding a new document, changes to an existing document or template when you close Word?
    Actually I think you misunderstood it script shouldn't have any connection with word 2016 aside when the user closes down the word. then script should do what it's told to do

    P.S. I think you misunderstood it because of my english as you can see my english isn't really that good so sorry for that
      My Computer


  4. Posts : 13,898
    Win10 Version 22H2 Pro and Home, Win11 Pro and Home
       #4

    Droyk said:
    Actually I think you misunderstood it script shouldn't have any connection with word 2016 aside when the user closes down the word. then script should do what it's told to do

    P.S. I think you misunderstood it because of my english as you can see my english isn't really that good so sorry for that
    What is it that needs to happen after Word is closed? I recall from my DOS days some 20+ years ago that a batch file could be written to open a program, remain in memory then when the program was closed run another program or command. That most likely won't work in Windows as beginning with Windows 95 the Disk Operating System started being blended into the GUI/Graphical User Interface, quite different from Windows 3.11 and earlier where DOS was installed first and Windows installed on top of that.
      My Computers


  5. Posts : 83
    Windows 10 Pro TH2
    Thread Starter
       #5

    Berton said:
    What is it that needs to happen after Word is closed?
    what I mean by no dialogues should appear is because I want a script to initiate a registry file after word closes

    so basically when a user normally click on registry file it first ask for user permission like this dialog
    I need a simple script to initiate whenever Word 2016 closes-hbmbzby.png

    and then another dialog appear
    I need a simple script to initiate whenever Word 2016 closes-gqwnz67.png
      My Computer


  6. Posts : 5,442
    Windows 11 Home
       #6

    regedit /s UI.reg

    But I would probably use bat instead.
      My Computer


  7. Posts : 83
    Windows 10 Pro TH2
    Thread Starter
       #7

    TairikuOkami said:
    regedit /s UI.reg

    But I would probably use bat instead.
    Well that's what I am asking I need bat script or any other kind of script to automatically do this.
      My Computer


  8. Posts : 42,737
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #8

    You can create a script with Autohotkey (free).

    Autohotkey is both a scripting language, and one which can manipulate and work with windows and processes.
    It has an extensive help file, and an active forum

    So you can do this: (outline only)
    Loop ; For ever
    Loop
    Until Word 2016 present
    ; Word 2016 has been detected}
    Loop
    Until Word 2016 not present
    ; Word 2016 closed}
    Execute your desired function
    End Loop {For ever}
      My Computers


  9. Posts : 83
    Windows 10 Pro TH2
    Thread Starter
       #9

    dalchina said:
    You can create a script with Autohotkey (free).

    Autohotkey is both a scripting language, and one which can manipulate and work with windows and processes.
    It has an extensive help file, and an active forum

    So you can do this: (outline only)
    Loop ; For ever
    Loop
    Until Word 2016 present
    ; Word 2016 has been detected}
    Loop
    Until Word 2016 not present
    ; Word 2016 closed}
    Execute your desired function
    End Loop {For ever}
    Well I never tried autohot key before so by instructions I created a new script and copy paste everything so now the issue begins how to use it as someone who don't even know autohot key language how should he work with this?

    and by the way this is what my script looks like
    Code:
    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    
    Loop ; For ever
    Loop
    Until Word 2016 present
    ; Word 2016 has been detected}
    Loop
    Until Word 2016 not present
    ; Word 2016 closed}
    Execute your desired function
    End Loop {For ever}
      My Computer


  10. Posts : 42,737
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #10

    I've just outlined the basic logic.
    You'd have to learn to use Autohotkey and read the help file... were you expecting someone to write it for you?
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:23.
Find Us




Windows 10 Forums