[THIN] Re: scripting

  • From: "Euan Cooper" <euan.cooper@xxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Wed, 30 Nov 2005 16:16:57 +1300

Here is a quick's dirty script I  wrote for our GIS admin to allow him to do a 
similar thing - checks for users using GIS applications on our MF servers and 
sends them a message to get off - after a couple of warnings it kills the GIS 
processes so he can update core data files  should give you a few pointers on 
how to do this - This script is run on each server and works quite well - you 
may be able to play with the QFARM /PROCCESS command to write a single script - 
or you could write another script and use the SOON command to schedule the main 
script on each of your MF servers
 
 
@echo off
::  CHECK_GIS.CMD - Script to check for active GIS users on Metaframe.
 
::  Users who have these apps open are given 2 minutes to close them and then a 
2nd check for these apps
::  is done.  Users who still have these apps open are given another minute to 
close them and another check is 
::  done.  Users who still have these apps open are given a further minute and 
then the processes are 
::  terminated.
 
%SystemDrive%
 
cd\
 
qprocess *|find "arcview.exe" >AVUsers.lst
for /f "tokens=1" %%i in (avUsers.lst) DO MSG %%i You currently have Arcview 
open Please exit this program so the CRS Data can be updated.
 
qprocess *|find "Arcmap.exe" >AmUsers.lst
for /f "tokens=1" %%i in (avmUsers.lst) DO MSG %%i You currently have ArcMap 
open Please exit this program so the CRS Data can be updated.
 
qprocess *|find "hawke.exe" >GMUsers.lst
for /f "tokens=1" %%i in (GMUsers.lst) DO MSG %%i You currently have Gismo II 
open Please exit this program so the CRS Data can be updated.
 
sleep 120
 
qprocess *|find "arcview.exe" >AVUsers.lst
for /f "tokens=1" %%i in (avUsers.lst) DO MSG %%i You currently have Arcview 
open Please exit this program so the CRS Data can be updated.
 
qprocess *|find "Arcmap.exe" >AmUsers.lst
for /f "tokens=1" %%i in (avmUsers.lst) DO MSG %%i You currently have ArcMap 
open Please exit this program sothe CRS Data can be updated.
 
qprocess *|find "hawke.exe" >GMUsers.lst
for /f "tokens=1" %%i in (GMUsers.lst) DO MSG %%i You currently have Gismo II 
open Please exit this program so the CRS Data can be updated.
 
sleep 60
 
qprocess *|find "arcview.exe" >AVUsers.lst
for /f "tokens=1" %%i in (avUsers.lst) DO MSG %%i You Have not closed Arcview 
yet!!!  This application will be closed in one minute so the CRS Data can be 
updated.
 
qprocess *|find "Arcmap.exe" >AmUsers.lst
for /f "tokens=1" %%i in (avmUsers.lst) DO MSG %%i You Have not closed Arcmap 
yet!!!  This application will be closed in one minute so the CRS Data can be 
updated.
 

qprocess *|find "hawke.exe" >GMUsers.lst
for /f "tokens=1" %%i in (GMUsers.lst) DO MSG %%i You Have not closed GISMo 
II!!!  This application will be closed in one minute so the CRS Data can be 
updated.
 
sleep 50
 
qprocess *|find "arcview.exe" >AVUsers.lst
for /f "tokens=4" %%i in (avUsers.lst) DO Kill %%i -f
 
qprocess *|find "Arcmap.exe" >AmUsers.lst
for /f "tokens=4" %%i in (avmUsers.lst) DO Kill %%i -f
 
qprocess *|find "hawke.exe" >GMUsers.lst
for /f "tokens=4" %%i in (GMUsers.lst) DO Kill %%i -f
 
 
 
 




On 11/29/05, Keith Sirmons < KSirmons@xxxxxxxxxxxx> wrote: 

Is there a good source for citrix scripts on the web?
 
There is an app that is updated frequently and I would like to write a scrip to 
do it automatically.  
When I do it by hand, I send a message to all that is logged on and tell them 
to close the app.  I wait 5 minuets and then logoff their sessions.  I then 
copy the application's new exe to the correct folder and let the users back 
onto the citrix server. 
 
 
I am wanting to create a script that will do this automatically.  I know how to 
script the file copies.  I'm just clueless to where to start for turning citrix 
off and back on gracefully.  
 
Thank you for any direction you can point me.
 
Keith Sirmons

 
Keith Sirmons
Microcomputer/LAN Administrator
College of Veterinary Medicine





-- 
Mark E. Schill 

Other related posts: