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
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:
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
I'm assuming you already have a program that deletes hiberfil.sys
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)
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.
@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.
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