Solved

Import Reg Files prior to Launching Citrix (pub'd app)

Posted on 2006-07-07
6
1,051 Views
Last Modified: 2012-05-05
I'd like to be able to launch .reg files for end-users (to change settings in their Outlook) from Citrix PS 4.0.  I imagine that I can call a batch file someway (start, call, etc) -- from a published app and then have that batch file not only import the registry items, but then to also launch Outlook.

So what I'd like to know is my syntax for calling this batch file?

And then inside the batch file I'd like to know if the following is the correct syntax?

   start /wait REGEDIT /s "q:\regs\outlook2003-nod.reg"
   call "q:\Program Files\Microsoft Office\OFFICE11\outlook.exe"

Now oddly enough when I launch the batch file along, it works -- but the problem is that the regedit doesn't seem to actually import.   What I'm trying to do is to shutoff things like the Desktop Alert.  So the reg file says:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences]
"AllowCommasInRecip"=dword:00000000
"PlaySound"=dword:00000000
"ShowEnvelope"=dword:00000000
"ChangePointer"=dword:00000000
"NewmailDesktopAlerts"=dword:00000000

If I launch the REG file it imports fine, but if I launch this as a batch file (silent with the /s from the batch file) - it does not import -- because if I load Outlook it does not revert my settings.
0
Comment
Question by:EllsworthAdhesives
6 Comments
 
LVL 19

Expert Comment

by:BLipman
Comment Utility
Instead of changing the parameters of the published application, I would use a targeted logon script.  You can use group policy to enable this and call a command file to modify the user registries.  Another approach (might be too late) is to use the Default User profile.  Set up a standard user to test and set your Office config to how you like it (merge in any reg files that affect HKCU manually).  Now log the user off and overwrite the NTUser.dat for Default User with your modified one (from your test user).
Now when a new person logs in they get a modified HKCU per your changes.  You would need to delete any profiles currently on the server to get the users to take the new registry.  
Otherwise, I would use gpo to launch my script for reg merges and publish Outlook normally.  
0
 

Author Comment

by:EllsworthAdhesives
Comment Utility
Sorry BLipman -- that's not what I was desiring, nor what I asked.

However, I actually figured it out myself and wanted to share it.

One can use the [HKEY_CURRENT_USER\...] and import commands using the "REG ADD" command at anytime.  This makes for an easy way to change any settings for users on the fly.  I suggest the use of Advanced Registry Tracer (http://www.elcomsoft.com/art.html) to determine the registry keys to use.  Simply launch an ART scan beforehand, launch then any applications and make the necessary changes, then re-run ART.  This will show you the changes, and allow you to jump to REGEDIT where you can export the keys (edit them in notepad to pull out additional keys you do not want for later importing).

Then publish your app as normal, then go back and change the Location to be CSCRIPT OUTLOOKSTART.VBS.  Changing the location after publishing, is required only to keep the current icon file -- publish this from the beginning and you get a different icon.  

OutlookStart.vbs is a simply a script that calls a batch file (this minimizes the opening of any DOS windows):

-------------------------------
Set oShell = CreateObject ("Wscript.Shell")
sCmd = "q:\regs\outlook2003-start.cmd"

'The 0 will make it run hidden
oShell.Run sCmd, 0, True
-------------------------------

This calls outlook2003-start.cmd which contains:
-------------------------------
echo off
cls
echo LAUNCHING OUTLOOK 2003
reg import "q:\regs\outlook2003-nod.reg"
call "q:\Program Files\Microsoft Office\OFFICE11\outlook.exe"
exit
-------------------------------

And OUTLOOK2003-NOD.REG contains:
-------------------------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences]
"AllowCommasInRecip"=dword:00000000
"PlaySound"=dword:00000000
"ShowEnvelope"=dword:00000000
"ChangePointer"=dword:00000000
"NewmailDesktopAlerts"=dword:00000000
------------------------------

Thus, you don't have to deal with anyone's profile, you don't deal with anyone's GPO, etc.  And you get precisely what you want every-time.  Furthermore, you could also setup the batch file that's called to parse through Windows or ActiveDirectory Group inclusions and apply or not apply particular settings based on memberships.
0
 
LVL 13

Expert Comment

by:gsgi
Comment Utility
Hey, congrats BLipman - I see you just got Citrix Master Certified!  The 4th!

-gsgi
0
 
LVL 19

Expert Comment

by:BLipman
Comment Utility
Thx gsgi!
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
Comment Utility
Closed, 500 points refunded.
Netminder
Site Admin
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

#Citrix #XenApp #Citrix XenApp #Citrix Concurrent License #Citrix Licensing #Citrix Policies
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now