1.    13 Aug 2016 #1
    Join Date : Jul 2016
    Granite Bay, CA
    Posts : 706
    Windows 10 Professional

    Start An EXE Minimized After Wake Up From Hibernate In Task Scheduler


    Hello, I want to start an EXE program Minimized, or better yet, hidden (so I don't see its program in the Taskbar) only when the computer comes back from Hibernate. (This EXE file does the command to delete the hiberfil.sys file.) It only runs for a split second, yet I don't want to see it on the screen when it opens and closes.

    How can I do that please?

    Thanks
      My ComputerSystem Spec
  2.    14 Aug 2016 #2
    Join Date : Jan 2015
    UK, Midlands
    Posts : 10,467
    Win 10 Pro (1703)

    Hello, I will answer part of your question, and suggest options for running minimised.
    Considering the task scheduler:
    This is the trigger event you need to specify:
    Click image for larger version. 

Name:	Snap 2016-08-14 at 08.55.59.jpg 
Views:	1 
Size:	12.8 KB 
ID:	96096

    I can't think why you'd want to delete the file unless you're desperately short of disk space...?

    You can launch a file minimised from the task scheduler:
    How to run a batch file or other file minimized

    You can use Autohotkey (free scripting tool) to launch it minimised
    Click image for larger version. 

Name:	Snap 2016-08-14 at 08.59.48.jpg 
Views:	1 
Size:	168.5 KB 
ID:	96097

    I'm assuming you already have a program that deletes hiberfil.sys
      My ComputerSystem Spec
  3.    14 Aug 2016 #3
    Join Date : Jul 2016
    Granite Bay, CA
    Posts : 706
    Windows 10 Professional
    Thread Starter

    Hello Panda Bear =)

    So I saw your first post before you edited it with the picture. I made the Task just like that in Task Scheduler and it actually WORKED!! Thank you so much. I Hibernated the computer, then turned it back on and unlocked the computer, and it went straight to the Desktop (how I had it before I Hibernated it) and no cmd window screen (the exe) showed up! It was hidden.

    The reason why I don't want that file is because it is just useless space sitting on the Hard Drive. I won't be running low on Disk space at all because I use backup drives for storage; I just like to keep the Local Drive as clean as possible from clutter (files that are useless for me).

    Also it's a cool little idea that I'm surprised that Microsoft hasn't yet implemented. (The only hold back is if you are running very low on disk space, then asking the computer to Hibernate would be difficult because there won't be enough space to create the hiberfil.sys file. You see, I have a little set up that when I press the Hibernate option, the computer creates the hiberfil.sys and Hibernates.)


    (I use a program called Macro Express for other projects, it's kinda similar to AutoKey, yet a bit more complex. But thanks for that suggestion as well)
      My ComputerSystem Spec
  4.    14 Aug 2016 #4
    Join Date : Dec 2015
    Posts : 5,416
    Windows10

    Seems a long winded way to use an exe file when simply using following from an admin command prompt

    powercfg - h off

    does the job.

    Frankly, I just do not see point of doing this anyway just to save a couple of GB. By deleting it, you create the problem of not having enough disk space to create it when low on storage memory- it would be there if you did not delete it.
      My ComputerSystem Spec
  5.    14 Aug 2016 #5
    Join Date : Jan 2015
    UK, Midlands
    Posts : 10,467
    Win 10 Pro (1703)

    @Cerberus- personally I'd agree and never delete it. But I thought better to give an answer.. rather than question the objective. I already knew what the task trigger was as I've used that for a long time- originally that took quite a while to identify. That command turns hibernate off (and so deletes the file)- which isn't what the OP was asking.
      My ComputerSystem Spec
  6.    15 Aug 2016 #6
    Join Date : Dec 2015
    Posts : 5,416
    Windows10

    Quote Originally Posted by dalchina View Post
    @Cerberus- personally I'd agree and never delete it. But I thought better to give an answer.. rather than question the objective. I already knew what the task trigger was as I've used that for a long time- originally that took quite a while to identify. That command turns hibernate off (and so deletes the file)- which isn't what the OP was asking.
    Sure but running again with on parameter turns it back on which I did not make clear. As I understand it, OP recreates hibernate n file on demand when closing down pc.

    My point was that deleting file to save space but still wanting ability to hibernate on demand can create issue when storage memory is low.

    Just seems to me to be messy and if pc crashed, would it get confused deleting his way thinking it had a hibernation file etc.

    I have ended up with corrupt hibernation files, missing hibernation files in past.

    Stil as you say OP's choice but I do not think it harms to ask why sometimes.
      My ComputerSystem Spec
  7.    15 Aug 2016 #7
    Join Date : Jul 2016
    Granite Bay, CA
    Posts : 706
    Windows 10 Professional
    Thread Starter

    Quote Originally Posted by cereberus View Post
    As I understand it, OP recreates hibernate n file on demand when closing down pc.
    That's exactly it. As of right now, there is no Hibernate file on the Local Drive.
    1) If I want to Hibernate the computer, I click Hibernate. I have a command that creates the Hibernate file, on demand, whenever I press Hibernate.
    2) If I shut down the computer, no Hibernate file gets created. So when I start up the computer, no Hibernate file will attempt to be deleted.
    3) Assuming I pressed Hibernate, that file is now created and the computer hibernates. Once I start the computer back up, that Hibernate file gets deleted.
    4) I have a solid state drive, which means that this file gets created quickly and gets deleted quickly. (I am aware that over a long period of time, this might slightly damage the hard drive, yet I rarely use Hibernate, so no worries)
    5) Assuming anything messes up, I am aware of methods of starting up the computer 'alternatively' (Safe Mode, alternate Operating System, etc...) I got a lot of computer fixing experience.

    Just to clear up the confusion that I read earlier after I marked the post as solved, this is my preference and I want the computer to do this. I really appreciate the person who helped me out and other comments

    Thanks
      My ComputerSystem Spec

 


Similar Threads
Thread Forum
Task Scheduler: Start a Program with Office
Does anyone know how to have Task Scheduler start a program to run with the launch of ANY Office application? I have a registry edit which will enable the black theme in Office 2016. It needs to be run each time any Office app opens. I can do...
General Support
Task Scheduler does not always wake the computer
I'v tried just about everything, including selecting the "wake the computer" option. Hibernate or Sleep, it makes little difference. I would expect it to always work or never work, but to have it just work sometimes makes troubleshooting a real...
General Support
Windows Arguments List - Start Programs Minimized with Task Scheduler.
Hello Community! I'm trying to get BBC iPlayer downloads to start automagically at 2100 so that it can start downloading Doctor Who. I'd like it to start minimized, but I am unsure how to do so. In addition to this, does anyone know if there...
Performance & Maintenance
How to show Command Prompt Window when running task in Task Scheduler?
Is there a way to make the "Command Prompt" window show when I have a task running in Windows task Scheduler? I would like to be able to view the progress of the task. For example, I have a program called "Zap2xml" that collects TV EPG data. It...
General Support
Solved Time Zone change causes error in Task Scheduler for every task
My issue is kind of strange. I am an insider currently on Windows 10 build 10240. All the build I have tried so far has this same error in task scheduler when I change my time zone to my current location which is kathmandu (UTC+5:45). When i change...
Performance & Maintenance
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 18:37.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums