EllsworthAdhesives
asked on
Import Reg Files prior to Launching Citrix (pub'd app)
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.r eg"
call "q:\Program Files\Microsoft Office\OFFICE11\outlook.ex e"
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\Softwar e\Microsof t\Office\1 1.0\Outloo k\Preferen ces]
"AllowCommasInRecip"=dword :00000000
"PlaySound"=dword:00000000
"ShowEnvelope"=dword:00000 000
"ChangePointer"=dword:0000 0000
"NewmailDesktopAlerts"=dwo rd:0000000 0
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.
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.r
call "q:\Program Files\Microsoft Office\OFFICE11\outlook.ex
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\Softwar
"AllowCommasInRecip"=dword
"PlaySound"=dword:00000000
"ShowEnvelope"=dword:00000
"ChangePointer"=dword:0000
"NewmailDesktopAlerts"=dwo
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.
ASKER
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.r eg"
call "q:\Program Files\Microsoft Office\OFFICE11\outlook.ex e"
exit
-------------------------- -----
And OUTLOOK2003-NOD.REG contains:
-------------------------- -----
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Softwar e\Microsof t\Office\1 1.0\Outloo k\Preferen ces]
"AllowCommasInRecip"=dword :00000000
"PlaySound"=dword:00000000
"ShowEnvelope"=dword:00000 000
"ChangePointer"=dword:0000 0000
"NewmailDesktopAlerts"=dwo rd:0000000 0
-------------------------- ----
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.
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
'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.r
call "q:\Program Files\Microsoft Office\OFFICE11\outlook.ex
exit
--------------------------
And OUTLOOK2003-NOD.REG contains:
--------------------------
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Softwar
"AllowCommasInRecip"=dword
"PlaySound"=dword:00000000
"ShowEnvelope"=dword:00000
"ChangePointer"=dword:0000
"NewmailDesktopAlerts"=dwo
--------------------------
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.
Hey, congrats BLipman - I see you just got Citrix Master Certified! The 4th!
-gsgi
-gsgi
Thx gsgi!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.