?
Solved

need to run a script when the user opens a application

Posted on 2008-11-17
12
Medium Priority
?
268 Views
Last Modified: 2012-08-13
i have an application published in citrix presentation server 4.0. this application requires a registry file (.reg) file run when the user opens the application. this regfile has license registration information as this info is stored in the users profile. is there a way i could run this file atleast once when the user opens this published application. this application is published on one of the servers in the farm and not all users use this application. so putting this in login script may be too much and. only some 25 users have access to this application and this reg file needs to be run only for these users
0
Comment
Question by:mgmohiuddin
  • 5
  • 5
  • 2
12 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 22977788
Are you sure the registry change can take place once the app has already launched?
0
 
LVL 18

Expert Comment

by:exx1976
ID: 22977958
Simple.  Publish a script that checks for the registry entry, makes the change if required, and then the script launches the app.
0
 

Author Comment

by:mgmohiuddin
ID: 22978130
creating a script and publishing the script is a great option. could you help me create one. when the user opens the application i want this to be added to his users profile. once this change is made, his application will be licensed. and then i want to run an application executable located on the local drive of the citrix server. i have already purchased the licenses, and this license in per user/per profile so every users profile needs to be licensed. created a .reg file, so a script will first make changes to the profile and then launch the application

[HKEY_CURRENT_USER\Software\DameWare Development\NT Utilities\DNTU\DWRCC Settings]
"Reg Update"=dword:00000001
"Registered Name Update"="Your Registered User Name"
"Reg Number Update"="Your License Number"

then  run the application for example c:\dameware\dm.exe
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
LVL 67

Expert Comment

by:sirbounty
ID: 22978789
A batch method would be as follows.

Not sure what you're looking at providing for:
"Registered Name Update"="Your Registered User Name"
"Reg Number Update"="Your License Number"

Reg add "HKCU\Software\DameWare Development\NT Utilities\DNTU\DWRCC Settings" /v "Reg Update" /t REG_DWORD /d 1
start c:\dameware\dm.exe

Open in new window

0
 

Author Comment

by:mgmohiuddin
ID: 22978893
i created a .reg file containing the required keys. these keys are for license registration. when a user wants to use this application this regfile registers the product in the users profile. then i created a batch file as follows

@echo off
 
regedit.exe /s c:\test.reg

"C:\Program Files\DameWare Development\DameWare NT Utilities\dwrcc.exe"

if i put start the exe is not running for some reason. it is working but  a command prompt is always open till i close the application. is there a war this command prompt is closed the moment the applicattion is opened
0
 
LVL 18

Accepted Solution

by:
exx1976 earned 2000 total points
ID: 22978902
That batch version would do the trick, however it would continually make the same registry entry, rather than checking for it's existence.

Either way, it should work.   If you want a VBS version, let me know and I whip one up for ya.

-exx
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 22979128
It's a "feature" with Start...try this:

Start "" "C:\Program Files\DameWare Development\DameWare NT Utilities\dwrcc.exe"
0
 

Author Comment

by:mgmohiuddin
ID: 22982792
thanks a lot, it is working. one last thing and i will close the question. i created a .cmd file that will add a few registry parameters and then launch the application. i published this .cmd file in citrix and when you launch this script it prompts,

RUN---Save---cancel

if user selects RUN its working. i dont want this option to be dsiplayed. is there a way to avoid getting this dialog box
0
 

Author Comment

by:mgmohiuddin
ID: 22983538
whenever we run the script which is published in citrix. when  the user launches the file, a dialogbox appears, asking if the user wants to RUN, Save or Cancel. is there a way i can aviod this dialog box from apprearing
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 22983820
Hmm - if it's the box I'm thinking of, it says something like "scripts can harm your computer..." - and is a safety feature built into the OS.

You can try right-clicking the shortcut, on the General tab there may be a Security section, with an "Unblock" button - clicking that may do it - but I'm thinking that one's more for EXE type applications.

Otherwise, is the script copied local?  I'm not very familiar with citrix, so not sure what you mean by "publish".  If it's local to the environment that the user is logged onto, it shouldn't be prompting...
0
 

Author Closing Comment

by:mgmohiuddin
ID: 31517520
if you can provide me with the vb script that will be wonderfull. thanks in advance
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 22993474
Was I overlooked here or did none of my comments help you?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
#CITRIX #XENDESKTOP #POC #Citrix Studio
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question