[windows2000] Re: Upgrade win2k pro to win2k server?

  • From: "Chris Berry" <compjma@xxxxxxxxxxx>
  • To: windows2000@xxxxxxxxxxxxx
  • Date: Wed, 07 May 2003 10:59:58 -0700

>From: "Sullivan, Glenn" <GSullivan@xxxxxxxxxxxxxx>
>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--------------->

That's pretty cool Glenn, do you know how to close open files on network 
shares programatically?  I have this app called InfoUSA that has a messed up 
license checking routine, every day or two I have to go into computer 
management and close all the connections to the license file, then restore 
that file from a backup copy.  I'd like to write myself a script to do this, 
but I don't know how to access the open files interface from the command 
line.  Anyone have an idea?

Chris Berry
compjma@xxxxxxxxxxx
Systems Administrator
JM Associates

"This email is ROT26 encrypted, by reading it you are in violation of the 
DMCA, and should turn yourself in to the authorities immediately."

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus


==================================
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

Other related posts: