On Wed, 7 May 2003 10:42:25 -0400, Sullivan, Glenn wrote: >Here is a .cmd script that you could schedule to run every so often... it >disconnects all sessions that have an "Idle" value of more than 0. > >Be careful of line wrap... I am going to number each line. Remove the >number, the period, and the space at the beginning of each line, and save it >as a .CMD file. Line 5 is intentionally left blank... > ><------------Start Script------------> >1. @Echo Off >2. setlocal >3. for /f "skip=4 tokens=1,4 delims=" %%i in ('net session') do call >:Process "%%i" >4. goto :EOF >5. >6. :Process >7. if %1=="The command completed successfully." goto :EOF >8. set @Session=%~1 >9. set @Computer=%@Session:~0,17% >10. set @Idle=%@Session:~62,5% >11. if not "%@Idle%"==" 0" net session %@Computer% /DELETE >12. Endlocal ><------------End Script---------------> Tx for the script. Have some questions though: 'm not sure I understand how it checks the net session-table. Problem is that no sessions are closed, so I figure the script doesn't quite work as expected. If you could explain the parameters involved, I'd be very grateful. Mail me privately if you want to. My batch-language skills are basic, to say the most... 8-/ BW, Sorin # Sorin Srbu, Systems Engineer Web: http://www.farmfak.uu.se/organisk/ # Dept of Medicinal Chemistry, Phone: +46 (0)18-4714482 >> 5 signals >> GSM # Div of Org Pharm Chem, Mobile Phone: +46 (0)701-718023 # BMC, Box 574, Uppsala University Fax: +46 (0)18-4714474 # SE-751 23 Uppsala, Sweden Visit: BMC, Husargatan 3, D5:512b # # Public PGP key available on request. ================================== To Unsubscribe, set digest or vacation mode or view archives use the below link. http://thethin.net/win2000list.cfm