How to programmatically change COM port FriendlyName


  1. Posts : 2
    Windows 7
       #1

    How to programmatically change COM port FriendlyName


    I have an installation script that changes the COM port numbers based on certain hardware that is installed. In Windows 2000, I use regini.exe to import the listing of registry entries below. The reason for this was to allow the permissions on the FriendlyName value to be changed.


    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
    Device Parameters
    PortName = COM5
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
    COM5: = "9600,n,8,1"
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
    COM1: = Delete
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1 [7]
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
    FriendlyName = Communications Port (COM5)
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1 [8 17]



    I tried this same process in Windows 7 and everything works except for changing the FriendlyName value. The only way I've been able to change this value is to manually (in regedit) "take ownership" of the "1" key and then change the permissions to Full Control. However, I need to do this in a script to make it transparent to the user.


    Any help would be greatly appreciated,

    Rich
      My Computer


  2. Posts : 846
    Windows 10 Pro
       #2

    quantum1976 said:
    I have an installation script that changes the COM port numbers based on certain hardware that is installed. In Windows 2000, I use regini.exe to import the listing of registry entries below. The reason for this was to allow the permissions on the FriendlyName value to be changed.


    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
    Device Parameters
    PortName = COM5
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
    COM5: = "9600,n,8,1"
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
    COM1: = Delete
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1 [7]
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1
    FriendlyName = Communications Port (COM5)
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI\PNP0501\1 [8 17]


    I tried this same process in Windows 7 and everything works except for changing the FriendlyName value. The only way I've been able to change this value is to manually (in regedit) "take ownership" of the "1" key and then change the permissions to Full Control. However, I need to do this in a script to make it transparent to the user.


    Any help would be greatly appreciated,

    Rich
    Hi and welcome to SevenForum
    For your first forum message on SF this is really heavy man...
    Seems like you like scripting.
    Have fun.
      My Computer


  3. Posts : 2
    Windows 7
    Thread Starter
       #3

    Yes, I've been doing this for years with Win 2K and XP. Fortunately I've been able to muddle throught it. But this one has me beat.

    I know that Win 7 has the TakeOwn.exe utility for files, is there something similar for the registry?


    Thanks again for any help,

    Rich
      My Computer


  4. Posts : 2
    Windows 7 Ultimate x64
       #4

    Try icacls.exe
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:53.
Find Us