Override win application confirmation messages over User Defined Apps

  1.    11 Jun 2018 #1

    Override win application confirmation messages over User Defined Apps

    Hi i have a windows form application developed in c#. I will customize my windows image to have only this app running on boot up. I will also have a notepad app available for the user. I would like to know if there's any way i can override the save data pop up which will arise for the notepad if the user when he decides to shutdown.
    On the power button click by the user,I just want my user application to be saved, ignore the notification from notepad and a normal shutdown to happen.
    Kindly help.
      My ComputerSystem Spec

  2. essenbe's Avatar
    Posts : 11,682
    Windows 10 Pro and Windows 10 Pro Insider
       11 Jun 2018 #2

    Try an admin comand prompt and paste this in it and see if it will work. shutdown.exe /s /t 0 /f

    If it works you can make a .bat file of it and shutdown using it. Make sure you save everything you want to save before running it. I'm sure this isn't the solution you were looking for. But, if it works as a work around, maybe you could try it until you find the answers you want.
      My ComputersSystem Spec

  3.    11 Jun 2018 #3

    Hi, This really works. Thanks alot.
    Just wanted to know if it is possible in windows to run this script/batch file when the user presses the power button? Can that be configured anywhere in the settings?
    I dont want to run it from the command prompt. Or any existing settings available to disable the save as notification before the shutdown?
      My ComputerSystem Spec

  4. essenbe's Avatar
    Posts : 11,682
    Windows 10 Pro and Windows 10 Pro Insider
       11 Jun 2018 #4

    I'm really unsure what you want to do exactly, but see if this will help you. You can schedule a task to be run at certain points Import Task to Task Scheduler in Windows | Windows 10 Tutorials
      My ComputersSystem Spec

  5.    11 Jun 2018 #5

    Hi, Let me explain a bit more.
    Imagine you have an application like an ATM running on your PC and a notepad. ATM application is of priority here. The user may or may not use the notepad.
    Scenario 1: The ATM 'kind of' application is running, the user has written some data on the notepad file. Now the user presses the power button(hardware button). The PC should save any data of the ATM 'kind of' application, not show any SAVE AS notification for the notepad application and shutdown the system.
    Is this possible on windows 10.
    PS: the application ATM is just an example. :)
      My ComputerSystem Spec

  6. essenbe's Avatar
    Posts : 11,682
    Windows 10 Pro and Windows 10 Pro Insider
       11 Jun 2018 #6

    If there is a way to do it, I am not aware of it, perhaps @Brink is.
      My ComputersSystem Spec

  7.    11 Jun 2018 #7

    Oh, Hopefully he will be able to solve my doubts then...
    Thank you @essenbe, you were very quick. :)
      My ComputerSystem Spec

  8. Brink's Avatar
    Posts : 35,414
    64-bit Windows 10 Pro build 18317
       12 Jun 2018 #8

    Hello Dipk11,

    I'm not aware of a way to have Windows have an application to automatically save itself when the power button is pressed. Normally, if a user shuts down or restarts with an unsaved file open, it'll cause a hang with a message for the user to go back and save their work first or continue to shut down or restart.

    I suppose you could set the default power button action to hibernate instead of shut down, so the computer will startup back to how it was before without losing anything. This of course will not help if the user presses and hold the power button for a hard shut down.

    Change Default Action of Power Button in Windows 10 | Windows 10 Tutorials

    It really is the responsibility of the user to make sure they have everything saved and closed before shutting down to be safe though.
      My ComputersSystem Spec

  9.    12 Jun 2018 #9

    Some applications, like Word, Excel etc, have an autosave option which is configurable (i.e how often to autosave). That's the closest soneone can get to autosave work before shutdown.
    As Shawn mentioned, it's the user's responsibility to save its work before shutdown.
      My ComputerSystem Spec

  10.    12 Jun 2018 #10

    Hi @Brink, Thank you for your reply.
    I just dont want to save the other applications unsaved data, hence i dont want the notifications/pop ups that come when i try to shut down.
    shutdown.exe /s /t 0 /f does the work but i want to execute this script on the power button press. This command directly shuts down without giving any warning to the user. There are ways where i can run this script in a batch file on the software shutdown. I do not wish to use the software shutdown button.
    I just want the power button available on the front panel connector of the PC to operate.
    Also the batch file doesnt run in the shutdown scripts option from gpedit.msc.
    I tried using the task scheduler, it works but theres no event for power button click.
    Can anybody actually help me in this?
      My ComputerSystem Spec


Related Threads
Source: Protecting customers from being intimidated into making an unnecessary purchase Microsoft Secure
Source: Application Engagement in Windows Timeline with User Activities - Building Apps for Windows
I messed around with my Win 10 in trying to uninstall all traces of a printer software and I may have messed it up slightly. Apps that I used to install with no issues are now met with a pop message saying the following: "The app you're trying to...
I ran Windows Update as normal this morning, but got a message at the top saying "Some settings are managed by your organisation." I looked on the forum, and sure enough, there were others with this problem. I chose the fix that involved GPEdit,...
Yet another reason I think the W10 release was premature. By about a year! After pinning some user-installed applications to the Start Menu they looked fine. Today, all the icons that should be displayed in the buttons are gone. To determine...

Tags for this Thread

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 11:05.
Find Us