0
I'm working on a little something and i need to 'simplify' a windows operation and i'm kinda stuck, i don't know if you guys can help me figure it out here.. so here's my problem and how i want it to be solved:
I need to be able to suspend a specific windows process for X seconds at the press of 1 or 2 buttons. Ideally one button to suspend it with a X seconds delay before it resumes, but could be 1 button to suspend it and another 1 to resume it.
What i expect it to be (then agian, could be a little different): create a .exe file and bind the file shortcut to a programmable button on one of my macro button on my keyboard. I need help to figure out a way to code this into something.. i tried to use a tool called pssuspend.exe but i couldn't get it to work.
Thanks for the help !
Without too much work and as a basic solution you can create a shortcut file to your pssuspend.exe, then edit the properties of it to add the process name to suspend as a parameter in the "Target" field. You can bind a shortcut key combo and set if it is to run minimised for example. You could do the same again for the resume. Can you suspend the process you have in mind without elevating? – HelpingHand – 2017-12-28T19:32:46.213
Thanks for the reply. But i can't figure out how to edit the properties of this .exe ? any hints ? Also, i'd like it to work while using another full screen application without the need of minimizing it. – Pier-Olivier Pellerin – 2017-12-29T00:27:19.743
You create a shortcut to it and edit the properties of that. – HelpingHand – 2017-12-29T08:39:49.127
Thanks again for the reply sir ! It seems to work when I click on my shortcut, it runs pssuspend with the correct arguments, but the new issue is that when I assign the macro key of my keyboard to this shortcut, it will ignore all arguments and only open the basic file without the custom arguments.. is there a workaround? Is there a way to create some sort of BAT file to help me ? – Pier-Olivier Pellerin – 2017-12-29T12:39:16.670
In that case, what about a little exe wrapper: Download and install AutoIt (https://www.autoitscript.com/site/autoit/). Create a new text file, give it the name "suspend.au3". Add the 3 lines:
– HelpingHand – 2017-12-29T13:04:43.420Run("C:\SysinternalsSuite\pssuspend.exe onedrive", "", @SW_HIDE)
Sleep(5000)
Run("C:\SysinternalsSuite\pssuspend.exe onedrive -r", "", @SW_HIDE)
Adjust the process as required from onedrive above. You can save and then right click and choose "Complie Script (x86)". This will generate you an exe. Adjust it you want to sleep (e.g. 3 secs) and unsuspend, create an exe for each task etc.I'm curious to know if the AutoIt approach proved more useful for the behaviour you're after? – HelpingHand – 2018-01-01T12:38:11.080