We help IT Professionals succeed at work.

help with a startup script

dirkdigs
dirkdigs asked
on
i need help with a script that will remove the CTFMON.EXE process for each user on a terminal server.

the reg file i created is this
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] "ctfmon.exe"=-
[HKEY_CURRENT_USER\Software\Microsoft\CTF] "Disable Thread Input Manager"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\CTF\MSUTB] "ShowDeskBand"=dword:00000000  

i need a smaple script for example
Rem *****This script implements registry settings to prevent CTFMON.EXE from re-registering itself on the system*****
REGEDIT -s <Path>\DisableCTF.REG

how and where would i apply this script so that i runs for each user who logs on t othe terminal server.

should i set it up as a startup script. do i apply it as a gpo on a computer object or an OU?

thansk for the input !!!

my servers are all 2003 terminal servers.
Comment
Watch Question

Have you tried to remove CTFmon the Micro$oft way?
http://support.microsoft.com/kb/282599/en

If you don't want to or are enable to:
How do I configure a Logon script for a user on the "Profile" tab in AD Users & Computers?

The field labeled "Logon script" on the "Profile" tab of the user properties dialog in the Active Directory Users and Computers MMC corresponds to the "scriptPath" attribute of the user object. The default location for Logon scripts specified by this attribute is the NetLogon share. By default, all users have read access to this share. The NetLogon share on the Domain Controller is located in the following folder:

%SystemRoot%\sysvol\sysvol\<domain DNS name>\scripts

where %SystemRoot% is usually "c:\winnt" and <domain DNS name> is the DNS name of the domain, similar to "MyDomain.com". This folder is replicated to all Domain Controllers in the domain. The usual practice is to enter the name of the Logon script, for example "NetLogon.bat", in the field labeled "Logon script" on the "Profile" tab for the user and place this file in the NetLogon share. The Logon script will run for the user when they Logon to any computer that is joined to the domain. You can also enter a UNC path in the "Logon script" field and place the file in another location. However, this location should be one that is replicated to all Domain Controllers. Alternatively, you can use a script or utility to assign the Logon script to the "scriptPath" attribute of the user object in Active Directory. A VBScript program to assign a value to this attribute for many users in bulk would be much faster than manually entering values for users one at a time in the MMC.


Can I Remove the Ctfmon.exe File?
Removing the Ctfmon.exe might cause problematic behavior in your Office XP programs, so removing it is not recommended. To prevent Ctfmon.exe from running, follow these steps.
Step 1: Uninstall Alternative User Input
To uninstall the alternative user input feature, set the installation state to Not Available in Office XP Setup.

Microsoft Windows Millennium Edition (Me), Microsoft Windows 98, or Microsoft Windows NT 4.0:

   1. Quit all Office programs.
   2. Click Start, point to Settings, and then click Control Panel.
   3. In Control Panel, double-click Add/Remove Programs.
   4. On the Install/Uninstall tab, click to select Microsoft Office XP product, where Office XP product is the name of the specific Office product being used. If you are using a standalone version of one of the Office programs, click to select the appropriate product in the list. Click Add/Remove.
   5. In the Maintenance Mode Options dialog box, select Add or Remove Features, and then click Next. This displays the Choose installation options for all Office applications and tools dialog box.
   6. Click the plus sign (+) next to Office Shared Features to expand it.
   7. Click the icon next to Alternative User Input, and then select Not Available.
   8. Click Update.

NOTE: If you have multiple Office XP products installed, for example, Office XP Professional and Publisher 2002, you must repeat the preceding steps for each installed product.

Microsoft Windows 2000 and Microsoft Windows XP:

   1. Quit all Office programs.
   2. Click Start, point to Settings, and then click Control Panel. NOTE: In Windows XP, click Start and then click Control Panel.

   3. In Control Panel, double-click Add/Remove Programs.NOTE: In Windows XP, click Add or Remove Programs.

   4. In the Currently installed programs list, click to select Microsoft Office XP product, where Office XP product is the name of the specific Office product being used. If you are using a standalone version of one of the Office programs, click to select the appropriate product in the list. Click Change.
   5. In the Maintenance Mode Options dialog box, select Add or Remove Features, and then click Next. This displays the Choose installation options for all Office applications and tools dialog box.
   6. Click the plus sign (+) next to Office Shared Features to expand it.
   7. Click the icon next to Alternative User Input, and then select Not Available.
   8. Click Update.

NOTE: If you have multiple Office XP products installed, for example, Office XP Professional and Publisher 2002, you must repeat the preceding steps for each installed product.
Step 2: Remove Alternative User Input Services from Text Services

   1. Click Start, point to Settings, and then click Control Panel.
   2. In the Control Panel, double-click Text Services.NOTE: In Windows XP, click Date, Time, Language, and Regional Options, and then click Regional and Language Options. On the Languages tab, click Details.

   3. Under Installed Services, select each input item that is listed, and then click Remove to remove the item. All items must be removed, one by one, except the following input service:

English (United States)- default Keyboard United States 101
Step 3: Run Regsvr32 /U on the Msimtf.dll and Msctf.dll Files

   1. Click Start and then click Run.
   2. In the Run dialog box, type the following command:
      Regsvr32.exe /u msimtf.dll
   3. Click OK.
   4. Repeat steps 1 through 3 for the Msctf.dll file. 

For additional information about how to remove CTFMon.exe, click the article number below to view the article in the Microsoft Knowledge Base:
313176  (http://support.microsoft.com/kb/313176/EN-US/ ) Programs May Start, Quit, Lose, and Gain Focus Randomly 

Open in new window

I would simply edit USRLOGON.CMD on the TSs (it is under SYSTEM32) and add that as the last line after :END. This runs for every single user every time they logon to a TS.

Cláudio Rodrigues
Citrix CTP

Author

Commented:
tsmvp"

are you talking about this line ?
"REGEDIT -s <Path>\DisableCTF.REG"
Awarded 2009
Top Expert 2010

Commented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.