QRYDEPTAPP is a command-line tool for Citrix Servers to check whether the current session is running a specified Published Application based on Department code. This utility was written for the purpose of allowing one login script to process specific commands for department coded published applications. This utility is FREEWARE and was written by Warren Simondson of Ctrl-Alt-Del IT Consultancy, Australia. www.ctrl-alt-del.com.au Thankyou to the CITRIX SDK available from www.citrix.com/cdn Usage: QRYDEPTAPP [deptcode] deptcode - identifies the published application name with the department code suffix (Not case sensitive. Published App cannot contain spaces.) (eg. QRYDEPTAPP ACCO checks a published app called explorer_acco for the last 4 letter code.) The ERRORLEVEL return code shows if the current session is running the specified Published Application based on Department Code. Example Script: usrlogon.cmd ------------ @ECHO OFF ::MAP K: FOR Specific Department ::******************************************************* ::ACCO - Any application that end with ACCO eg PUB APP NAME is DESKTOP_ACCO or EXCEL_ACCO :SUB1 QRYDEPTAPP ACCO :: No Match - goto sub2 IF ERRORLEVEL 1 goto SUB2 echo This is the correct published app. echo put other commands here for this app like: :: MAP K DRIVE net use k: \\server\accoshare GOTO END ::******************************************************* ::EXEC - Any application that end with EXEC eg PUB APP NAME is DESKTOP_EXEC or EXCEL_EXEC :SUB2 QRYDEPTAPP EXEC :: No Match - goto end IF ERRORLEVEL 1 goto end echo This is the correct published app. echo put other commands here for this app like: :: MAP K DRIVE net use k: \\server\execshare GOTO END ::******************************************************* :END The freeware version is offered AS IS. Ctrl-Alt-Del IT Consultancy has made every effort possible to ensure that QRYDEPTAPP is free of any bugs or errors, however in no way is QRYDEPTAPP to be considered error or bug free. You assume all responsibility for any damages or lost data that may result from any errors or bugs in QRYDEPTAPP. IN NO EVENT WILL Ctrl-Alt-Del IT Consultancy BE LIABLE TO YOU FOR ANY GENERAL, SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR OTHER DAMAGES ARISING OUT OF THIS PRODUCT.