Run a scheduled task only once based on an event The Next CEO of Stack OverflowOnly...

Calculate the Mean mean of two numbers

Is a distribution that is normal, but highly skewed, considered Gaussian?

Can this transistor (2n2222) take 6V on emitter-base? Am I reading datasheet incorrectly?

Mathematica command that allows it to read my intentions

Man transported from Alternate World into ours by a Neutrino Detector

Can I cast Thunderwave and be at the center of its bottom face, but not be affected by it?

Can you teleport closer to a creature you are Frightened of?

How seriously should I take size and weight limits of hand luggage?

pgfplots: How to draw a tangent graph below two others?

How to unfasten electrical subpanel attached with ramset

Another proof that dividing by 0 does not exist -- is it right?

Calculating discount not working

Is it a bad idea to plug the other end of ESD strap to wall ground?

Prodigo = pro + ago?

Read/write a pipe-delimited file line by line with some simple text manipulation

Does int main() need a declaration on C++?

Create custom note boxes

Compilation of a 2d array and a 1d array

Are British MPs missing the point, with these 'Indicative Votes'?

How dangerous is XSS

Early programmable calculators with RS-232

Does Germany produce more waste than the US?

Free fall ellipse or parabola?

Why did early computer designers eschew integers?



Run a scheduled task only once based on an event



The Next CEO of Stack OverflowOnly administrator account can run scheduled tasksModify a scheduled task with PowerShellShutdown/deallocate VM doesn't work in scheduled taskGet-CimInstance not working when run from Scheduled TaskMapped Drive inaccessible from Windows Scheduled taskScheduled Task won't run in Windows 10 when started by schedulerTask Scheduler - scheduled task to run as SYSTEM not fireIssues sending emails remotely using Powershell script - Server 2012 R2How to detect if a specific scheduled task is running?Scheduled task after 24 Computer Uptime












0















I have a task that I want to run just once each time the system memory reaches less than 10 %.
Scheduled Task Trigger



Would this run until the memory is less than 10% or will it run just once? If it runs until less than 10%, how do I get it to just run once?



The task I am running is a PowerShell script










share|improve this question









New contributor




techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I have a task that I want to run just once each time the system memory reaches less than 10 %.
    Scheduled Task Trigger



    Would this run until the memory is less than 10% or will it run just once? If it runs until less than 10%, how do I get it to just run once?



    The task I am running is a PowerShell script










    share|improve this question









    New contributor




    techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have a task that I want to run just once each time the system memory reaches less than 10 %.
      Scheduled Task Trigger



      Would this run until the memory is less than 10% or will it run just once? If it runs until less than 10%, how do I get it to just run once?



      The task I am running is a PowerShell script










      share|improve this question









      New contributor




      techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have a task that I want to run just once each time the system memory reaches less than 10 %.
      Scheduled Task Trigger



      Would this run until the memory is less than 10% or will it run just once? If it runs until less than 10%, how do I get it to just run once?



      The task I am running is a PowerShell script







      windows scheduled-tasks






      share|improve this question









      New contributor




      techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 1 hour ago







      techguy1029













      New contributor




      techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 hours ago









      techguy1029techguy1029

      12




      12




      New contributor




      techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      techguy1029 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Assuming the task you're running is a script, you can add a line setting the Task itself to disabled as the script completes:



          move "C:WINDOWSTasksTEST TASK.job" "C:WINDOWSTasksTEST TASK.bak"



          From here: https://serverfault.com/questions/164097/is-it-possible-to-disable-a-scheduled-task-from-the-command-line-in-windows-xp



          Or you could write a checkfile at the end of the task, and check for its existence at the beginning of the task:



          if exist complete.file goto :eof


          PowerShell makes this even easier:



          Disable-ScheduledTask -TaskName "TaskName"


          From here: https://serverfault.com/questions/912486/enable-and-disable-scheduled-task-with-powershell-and-variable






          share|improve this answer
























          • Ok. So if I needed the task again later on, I would just disable and enable the task in the powershell script?

            – techguy1029
            1 hour ago













          • Your question does not specify the means by which you want the task to be re-enabled. If you disabled it via PS (that's the better way, anyway), you'd be able to enable it using either PS or the Task Scheduler UI. Disabling it by renaming means you'd have to rename it back to filename.task, and to reverse the checkfile method you'd just delete the checkfile.

            – music2myear
            51 mins ago












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          techguy1029 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1420150%2frun-a-scheduled-task-only-once-based-on-an-event%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Assuming the task you're running is a script, you can add a line setting the Task itself to disabled as the script completes:



          move "C:WINDOWSTasksTEST TASK.job" "C:WINDOWSTasksTEST TASK.bak"



          From here: https://serverfault.com/questions/164097/is-it-possible-to-disable-a-scheduled-task-from-the-command-line-in-windows-xp



          Or you could write a checkfile at the end of the task, and check for its existence at the beginning of the task:



          if exist complete.file goto :eof


          PowerShell makes this even easier:



          Disable-ScheduledTask -TaskName "TaskName"


          From here: https://serverfault.com/questions/912486/enable-and-disable-scheduled-task-with-powershell-and-variable






          share|improve this answer
























          • Ok. So if I needed the task again later on, I would just disable and enable the task in the powershell script?

            – techguy1029
            1 hour ago













          • Your question does not specify the means by which you want the task to be re-enabled. If you disabled it via PS (that's the better way, anyway), you'd be able to enable it using either PS or the Task Scheduler UI. Disabling it by renaming means you'd have to rename it back to filename.task, and to reverse the checkfile method you'd just delete the checkfile.

            – music2myear
            51 mins ago
















          0














          Assuming the task you're running is a script, you can add a line setting the Task itself to disabled as the script completes:



          move "C:WINDOWSTasksTEST TASK.job" "C:WINDOWSTasksTEST TASK.bak"



          From here: https://serverfault.com/questions/164097/is-it-possible-to-disable-a-scheduled-task-from-the-command-line-in-windows-xp



          Or you could write a checkfile at the end of the task, and check for its existence at the beginning of the task:



          if exist complete.file goto :eof


          PowerShell makes this even easier:



          Disable-ScheduledTask -TaskName "TaskName"


          From here: https://serverfault.com/questions/912486/enable-and-disable-scheduled-task-with-powershell-and-variable






          share|improve this answer
























          • Ok. So if I needed the task again later on, I would just disable and enable the task in the powershell script?

            – techguy1029
            1 hour ago













          • Your question does not specify the means by which you want the task to be re-enabled. If you disabled it via PS (that's the better way, anyway), you'd be able to enable it using either PS or the Task Scheduler UI. Disabling it by renaming means you'd have to rename it back to filename.task, and to reverse the checkfile method you'd just delete the checkfile.

            – music2myear
            51 mins ago














          0












          0








          0







          Assuming the task you're running is a script, you can add a line setting the Task itself to disabled as the script completes:



          move "C:WINDOWSTasksTEST TASK.job" "C:WINDOWSTasksTEST TASK.bak"



          From here: https://serverfault.com/questions/164097/is-it-possible-to-disable-a-scheduled-task-from-the-command-line-in-windows-xp



          Or you could write a checkfile at the end of the task, and check for its existence at the beginning of the task:



          if exist complete.file goto :eof


          PowerShell makes this even easier:



          Disable-ScheduledTask -TaskName "TaskName"


          From here: https://serverfault.com/questions/912486/enable-and-disable-scheduled-task-with-powershell-and-variable






          share|improve this answer













          Assuming the task you're running is a script, you can add a line setting the Task itself to disabled as the script completes:



          move "C:WINDOWSTasksTEST TASK.job" "C:WINDOWSTasksTEST TASK.bak"



          From here: https://serverfault.com/questions/164097/is-it-possible-to-disable-a-scheduled-task-from-the-command-line-in-windows-xp



          Or you could write a checkfile at the end of the task, and check for its existence at the beginning of the task:



          if exist complete.file goto :eof


          PowerShell makes this even easier:



          Disable-ScheduledTask -TaskName "TaskName"


          From here: https://serverfault.com/questions/912486/enable-and-disable-scheduled-task-with-powershell-and-variable







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 1 hour ago









          music2myearmusic2myear

          32k860101




          32k860101













          • Ok. So if I needed the task again later on, I would just disable and enable the task in the powershell script?

            – techguy1029
            1 hour ago













          • Your question does not specify the means by which you want the task to be re-enabled. If you disabled it via PS (that's the better way, anyway), you'd be able to enable it using either PS or the Task Scheduler UI. Disabling it by renaming means you'd have to rename it back to filename.task, and to reverse the checkfile method you'd just delete the checkfile.

            – music2myear
            51 mins ago



















          • Ok. So if I needed the task again later on, I would just disable and enable the task in the powershell script?

            – techguy1029
            1 hour ago













          • Your question does not specify the means by which you want the task to be re-enabled. If you disabled it via PS (that's the better way, anyway), you'd be able to enable it using either PS or the Task Scheduler UI. Disabling it by renaming means you'd have to rename it back to filename.task, and to reverse the checkfile method you'd just delete the checkfile.

            – music2myear
            51 mins ago

















          Ok. So if I needed the task again later on, I would just disable and enable the task in the powershell script?

          – techguy1029
          1 hour ago







          Ok. So if I needed the task again later on, I would just disable and enable the task in the powershell script?

          – techguy1029
          1 hour ago















          Your question does not specify the means by which you want the task to be re-enabled. If you disabled it via PS (that's the better way, anyway), you'd be able to enable it using either PS or the Task Scheduler UI. Disabling it by renaming means you'd have to rename it back to filename.task, and to reverse the checkfile method you'd just delete the checkfile.

          – music2myear
          51 mins ago





          Your question does not specify the means by which you want the task to be re-enabled. If you disabled it via PS (that's the better way, anyway), you'd be able to enable it using either PS or the Task Scheduler UI. Disabling it by renaming means you'd have to rename it back to filename.task, and to reverse the checkfile method you'd just delete the checkfile.

          – music2myear
          51 mins ago










          techguy1029 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          techguy1029 is a new contributor. Be nice, and check out our Code of Conduct.













          techguy1029 is a new contributor. Be nice, and check out our Code of Conduct.












          techguy1029 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1420150%2frun-a-scheduled-task-only-once-based-on-an-event%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Cannot install PyQt5 The Next CEO of Stack OverflowCannot install tcpreplay 3.4.4cannot...

          Kapp-Putsch Acontecimentos | Outros artigos | Menu de navegação

          Why did early computer designers eschew integers? The Next CEO of Stack OverflowWhat register...