4 Replies Latest reply: Nov 26, 2002 9:24 AM by adipalo RSS

Patrol on Citrix and the cache directory

RobbieG77

I'm trying to setup Patrol on citrix and am looking for advice on the PATROL_CACHE directory. My plan is to set the cache variable to something like y:\bmc software\patrol\cache\%username%. I am trying to set the cache variable in the \winnt\system32\usrlogon file using the set command but am not having any luck making it work. Anyone already put Patrol citrix and have any ideas on handling this. Or advice on using the set command in the usrlogon script? The command I'm using works fine from the command line but when in the script it doesn't work at all. Thanks.

  • 1.
    patrick

    Hello Robbie,

    I whipped this up...Give it a spin...

    @echo off<br />&#58;&#58; #############################################################<br />&#58;&#58; Script Name&#58; patrol_start.bat<br />&#58;&#58; Author&#58; Patrick McQuade, ManageIT Inc. http&#58;//www.manageit.ca<br />&#58;&#58; Date Started&#58; 07.23.2002<br />&#58;&#58; <br />&#58;&#58; CVS Id&#58; $Id&#58; patrol_start.bat,v 1.1 2002/7/24 00&#58;43&#58;23 pjm Exp $<br />&#58;&#58;<br />&#58;&#58; Synopsis&#58; Start a Patrol Console for an end user<br />&#58;&#58; #############################################################<br /><br />&#58;&#58; ##### Environment Variable Definitions #####<br />set TOP_DIR=C&#58;\PATROL_USERS<br />set PATROL_USER_LOGDIR=%TOP_DIR%\logs<br />set PATROL_USER_LOGFILE=%PATROL_USER_LOGDIR%\&quot;%USERNAME%.log&quot;<br /><br />&#58;&#58; If the TOP_DIR directory does not exist, create it...<br />if NOT exist %TOP_DIR%\nul &#40;<br />  echo %DATE% %TIME% --&gt; Creating the directory %TOP_DIR% for the user&#58; %USERNAME% &gt; %PATROL_USER_LOGFILE%<br />  mkdir %TOP_DIR%<br />&#41;<br />&#58;&#58; If the %TOP_DIR%\logs file does not exist, create it...<br />if NOT exist %TOP_DIR%\logs\nul &#40;<br />  mkdir %TOP_DIR%\logs<br />&#41;<br /><br />echo %DATE% %TIME% --&gt; User&#58; %USERNAME% logged in. &gt; %PATROL_USER_LOGFILE%<br /><br />&#58;&#58; Set the User's Patrol Cache Directory...<br />set PATROL_CACHE=%TOP_DIR%\%USERNAME%<br />echo %DATE% %TIME% --&gt; The PATROL_CACHE for %USERNAME% is %PATROL_CACHE% &gt; %PATROL_USER_LOGFILE%<br /><br />&#58;&#58; Start the Patrol Console for the user...<br />echo %DATE% %TIME% --&gt; Starting the Patrol Console for the user&#58; %USERNAME%<br />start Patrol.exe -id &quot;%USERNAME%&quot;<br />exit<br /><br />&#58;&#58;EOF


    This should be enough to get you started. Instead of publishing the Patrol.exe application within Citrix, you publish the patrol_start.bat file (the script above). When a user starts this application, the script above is run and sets all of the variables defined in the script, and they all have their own respective PATROL_CACHE variables...
    Of course this is a "bare bones"script, but it should be enough to get you started...

    Let me know if it works for ya...

    -patrick

  • 2.
    RobbieG77

    Thanks for the reply. I'll give that a try.

  • 3.
    RobbieG77

    OK, I have the script built but when I run it I get this error message. The permissions on the directory are as follows:
    CO Full
    Everone Change
    host\Admin Full
    SYSTEM Full

    Here is the error message.

  • 4.
    adipalo

    Hi Robbie,

    Maybe you made a "copy and paste" of the Patrick code from your Web Browser in a new text file (I say so because I made it!). If so, make sure that you cancelled all the blank characters at the end of any line. In fact, it seems that the value of your %PATROL_CACHE% variable is set to "C:\PATROL_USERS\patrol " (without quotes), so the Console tries to create files in a non-existent directory (a directory can't end with blanks).

    Patrick, I found your solution very interesting, so I tried to apply it to my environment too (Windows NT4 with Citrix Metaframev.1.8). I have some comments about your code that I think can be useful:
    - If %TOP_DIR% doesn't exist, even %PATROL_USER_LOGDIR% and %PATROL_USER_LOGFILE% don't exist, so you can't log the creation of %TOP_DIR% in the %PATROL_USER_LOGFILE% file.
    - On my Citrix system I have no %DATE% and %TIME% variables, so I can't use them in the logfile.
    - I think it's better to append the lines in the logfile (>>), rather than overwrite it continuously (>).

    Here is the batch file after my modifications:

    <br />@echo off<br />&#58;&#58; ##### Environment Variable Definitions #####<br />set TOP_DIR=C&#58;\USERS\PATROL<br />set PATROL_USER_LOGDIR=%TOP_DIR%\logs<br />set PATROL_USER_LOGFILE=%PATROL_USER_LOGDIR%\%USERNAME%.log<br /><br />&#58;&#58; If the TOP_DIR directory does not exist, create it...<br />if NOT exist %TOP_DIR%\nul &#40;<br />  mkdir %TOP_DIR%<br />&#41;<br />&#58;&#58; If the %TOP_DIR%\logs directory does not exist, create it...<br />if NOT exist %TOP_DIR%\logs\nul &#40;<br />  mkdir %TOP_DIR%\logs<br />&#41;<br /><br />date /T &gt;&gt; %PATROL_USER_LOGFILE%<br />time /T &gt;&gt; %PATROL_USER_LOGFILE%<br />echo    User %USERNAME% logged in. &gt;&gt; %PATROL_USER_LOGFILE%<br /><br />&#58;&#58; Set the User's Patrol Cache Directory...<br />set PATROL_CACHE=%TOP_DIR%\%USERNAME%<br />echo    The PATROL_CACHE for %USERNAME% is %PATROL_CACHE%. &gt;&gt; %PATROL_USER_LOGFILE%<br /><br />&#58;&#58; Start the Patrol Console for the user...<br />echo    Starting the Patrol Console for the user %USERNAME%... &gt;&gt; %PATROL_USER_LOGFILE%<br />start Patrol.exe -id &quot;%USERNAME%&quot;<br /><br />



    Please send me your comments.
    Thank you again for your solution!

    Rgds,

    Alessandro.