Launching a script after 10 minutes of inactivity?Hello all. I'm a newbie here on this forum, although I have been lurking in the background for some time now.<br>I am wondering if anyone knows of a way to launch a script after 10 minutes of inactivity, similar to the way a screensaver kicks in.<br>I'd also like it to close if there is any activity at all. So basically, I'm looking for a screensaver-type of script that will not interfere with the WIndows screensaver and will close if the mouse is moved, key is pressed, etc.<br><br>© 2009 Microsoft Corporation. All rights reserved.Thu, 13 Nov 2008 08:09:03 Z2991aa59-07c6-413e-8bf0-9ffa2bd8f0d3http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/2991aa59-07c6-413e-8bf0-9ffa2bd8f0d3#2991aa59-07c6-413e-8bf0-9ffa2bd8f0d3http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/2991aa59-07c6-413e-8bf0-9ffa2bd8f0d3#2991aa59-07c6-413e-8bf0-9ffa2bd8f0d3xjbonehttp://social.technet.microsoft.com/Profile/en-US/?user=xjboneLaunching a script after 10 minutes of inactivity?Hello all. I'm a newbie here on this forum, although I have been lurking in the background for some time now.<br>I am wondering if anyone knows of a way to launch a script after 10 minutes of inactivity, similar to the way a screensaver kicks in.<br>I'd also like it to close if there is any activity at all. So basically, I'm looking for a screensaver-type of script that will not interfere with the WIndows screensaver and will close if the mouse is moved, key is pressed, etc.<br><br>Wed, 12 Nov 2008 17:24:05 Z2008-11-12T17:37:12Zhttp://social.technet.microsoft.com/Forums/en-US/ITCG/thread/2991aa59-07c6-413e-8bf0-9ffa2bd8f0d3#058c8c2d-ac96-4629-a394-f0a139a16569http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/2991aa59-07c6-413e-8bf0-9ffa2bd8f0d3#058c8c2d-ac96-4629-a394-f0a139a16569Salvador Manaois IIIhttp://social.technet.microsoft.com/Profile/en-US/?user=Salvador%20Manaois%20IIILaunching a script after 10 minutes of inactivity?<p>I have, on my PC, the screensaver Mystify.scr which is triggered when my computer has been idle for 15 minutes. I have a &quot;watchdog&quot; service (actually) script that checks when this screensaver is triggered and if so, deletes all BAK files from my D: drive. The script should exit once the computer becomes active (when the screensaver process exits). Here's my script:<br><br></p> <div style="border-right:#7f9db9 1px solid;border-top:#7f9db9 1px solid;font-size:11px;overflow:auto;border-left:#7f9db9 1px solid;line-height:100%! important;border-bottom:#7f9db9 1px solid;font-family:Courier New;background-color:white"> <table style="border-top-width:0px;border-left-width:0px;margin:2px 0px;width:99%;border-bottom:#eee 0px solid;border-collapse:collapse;background-color:#fff;border-right-width:0px" cellspacing=0 cellpadding=0> <colgroup> <col style="border-right:gray 1px solid;padding-right:5px;padding-left:10px;font-size:11px;vertical-align:top;width:5px;color:gray;font-family:Courier New;background-color:#eee;text-align:right"> <col style="padding-left:10px;font-size:11px;border-bottom:#f7f7f7 1px solid;font-family:Courier New;white-space:nowrap"> <tbody> <tr> <td><nobr>1</nobr></td> <td><font style="font-size:11px">sHost = </font><font style="color:blue">&quot;.&quot;</font><font style="font-size:11px"> </font></td></tr> <tr> <td><nobr>2</nobr></td> <td style="background-color:#f7f7f7"></font><font style="color:blue">Set</font><font style="font-size:11px"> oWMIService = GetObject(</font><font style="color:blue">&quot;winmgmts:\\&quot;</font><font style="font-size:11px"> &amp; sHost &amp; </font><font style="color:blue">&quot;\root\cimv2&quot;</font><font style="font-size:11px">)  </font></td></tr> <tr> <td><nobr>3</nobr></td> <td></font><font style="color:blue">Set</font><font style="font-size:11px"> oEventSource = oWMIService.ExecNotificationQuery _  </font></td></tr> <tr> <td><nobr>4</nobr></td> <td style="background-color:#f7f7f7">    (</font><font style="color:blue">&quot;SELECT * FROM __InstanceOperationEvent&quot;</font><font style="font-size:11px"> &amp; _  </font></td></tr> <tr> <td><nobr>5</nobr></td> <td>     </font><font style="color:blue">&quot; WITHIN 10 WHERE TargetInstance ISA 'Win32_Process'&quot;</font><font style="font-size:11px">)  </font></td></tr> <tr> <td><nobr>6</nobr></td> <td style="background-color:#f7f7f7"></font><font style="color:blue">Do</font><font style="font-size:11px"> </font><font style="color:blue">While</font><font style="font-size:11px"> </font><font style="color:blue">True</font><font style="font-size:11px"> </font></td></tr> <tr> <td><nobr>7</nobr></td> <td>    </font><font style="color:blue">Set</font><font style="font-size:11px"> oEventObject = oEventSource.NextEvent()  </font></td></tr> <tr> <td><nobr>8</nobr></td> <td style="background-color:#f7f7f7">    </font><font style="color:blue">If</font><font style="font-size:11px"> oEventObject.TargetInstance.Name = </font><font style="color:blue">&quot;Mystify.scr&quot;</font><font style="font-size:11px"> </font><font style="color:blue">Then</font><font style="font-size:11px"> </font></td></tr> <tr> <td><nobr>9</nobr></td> <td>        </font><font style="color:blue">Set</font><font style="font-size:11px"> colItems = oWMIService.ExecQuery _  </font></td></tr> <tr> <td><nobr>10</nobr></td> <td style="background-color:#f7f7f7">        (</font><font style="color:blue">&quot;Select * from Win32_OperatingSystem&quot;</font><font style="font-size:11px">)  </font></td></tr> <tr> <td><nobr>11</nobr></td> <td>        </font><font style="color:blue">For</font><font style="font-size:11px"> </font><font style="color:blue">Each</font><font style="font-size:11px"> oItem in colItems  </font></td></tr> <tr> <td><nobr>12</nobr></td> <td style="background-color:#f7f7f7">           DelFiles(</font><font style="color:blue">&quot;D:&quot;</font><font style="font-size:11px">)  </font></td></tr> <tr> <td><nobr>13</nobr></td> <td>        </font><font style="color:blue">Next</font><font style="font-size:11px"> </font></td></tr> <tr> <td><nobr>14</nobr></td> <td style="background-color:#f7f7f7">    </font><font style="color:blue">End</font><font style="font-size:11px"> </font><font style="color:blue">If</font><font style="font-size:11px"> </font></td></tr> <tr> <td><nobr>15</nobr></td> <td></font><font style="color:blue">Loop</font><font style="font-size:11px"> </font></td></tr> <tr> <td><nobr>16</nobr></td> <td style="background-color:#f7f7f7"> </td></tr> <tr> <td><nobr>17</nobr></td> <td></font><font style="color:blue">Sub</font><font style="font-size:11px"> DelFiles(strDrv)  </font></td></tr> <tr> <td><nobr>18</nobr></td> <td style="background-color:#f7f7f7">  </font><font style="color:blue">Set</font><font style="font-size:11px"> colFiles = oWMIService.ExecQuery _  </font></td></tr> <tr> <td><nobr>19</nobr></td> <td>      (</font><font style="color:blue">&quot;Select * from CIM_DataFile Where Drive =  '&quot;</font><font style="font-size:11px"> &amp; _  </font></td></tr> <tr> <td><nobr>20</nobr></td> <td style="background-color:#f7f7f7">        strDrv &amp; </font><font style="color:blue">&quot;' and Extension = 'bak'&quot;</font><font style="font-size:11px">)  </font></td></tr> <tr> <td><nobr>21</nobr></td> <td>  </font><font style="color:blue">For</font><font style="font-size:11px"> </font><font style="color:blue">Each</font><font style="font-size:11px"> objFile in colFiles  </font></td></tr> <tr> <td><nobr>22</nobr></td> <td style="background-color:#f7f7f7">      objFile.Delete  </td></tr> <tr> <td><nobr>23</nobr></td> <td>  </font><font style="color:blue">Next</font><font style="font-size:11px"> </font></td></tr> <tr> <td><nobr>24</nobr></td> <td style="background-color:#f7f7f7"></font><font style="color:blue">End</font><font style="font-size:11px"> </font><font style="color:blue">Sub</font><font style="font-size:11px"> </font></td></tr></tbody></table></div> <p>Regards,<br><br><strong>Salvador Manaois III</strong><br>C|EH MCSE MCSA MCITP|<em>Server/Enterprise Admin</em><br><strong>Bytes &amp; Badz </strong>: <a href="http://badzmanaois.blogspot.com/">http://badzmanaois.blogspot.com</a><br><br></p>Thu, 13 Nov 2008 08:09:03 Z2008-11-13T08:09:03Z