Link to home
Start Free TrialLog in
Avatar of mgmohiuddin
mgmohiuddin

asked on

need to run a script when the user opens a application

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
Avatar of sirbounty
sirbounty
Flag of United States of America image

Are you sure the registry change can take place once the app has already launched?
Simple.  Publish a script that checks for the registry entry, makes the change if required, and then the script launches the app.
Avatar of mgmohiuddin
mgmohiuddin

ASKER

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
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

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
ASKER CERTIFIED SOLUTION
Avatar of exx1976
exx1976
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's a "feature" with Start...try this:

Start "" "C:\Program Files\DameWare Development\DameWare NT Utilities\dwrcc.exe"
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
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
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...
if you can provide me with the vb script that will be wonderfull. thanks in advance
Was I overlooked here or did none of my comments help you?