Windows 7 Forums


Windows 7: How to programmatically change COM port FriendlyName

18 May 2010   #1

Windows 7
 
 
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 System SpecsSystem Spec

18 May 2010   #2

Windows 7 Ultimate (32 bit)
Surprise, Arizona
 
 

Quote   Quote: Originally Posted by quantum1976 View Post
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 System SpecsSystem Spec
19 May 2010   #3

Windows 7
 
 

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 System SpecsSystem Spec
.


29 Nov 2011   #4

Windows 7 Ultimate x64
 
 

Try icacls.exe
My System SpecsSystem Spec
Reply

 How to programmatically change COM port FriendlyName problems?



Thread Tools



Similar help and support threads for: How to programmatically change COM port FriendlyName
Thread Forum
360 wireless receiver doesn't work until I change usb port. Gaming
change USB port numbers Hardware & Devices
Mute the audio mixer application programmatically Sound & Audio
How to disable sleep mode programmatically General Discussion
Comcast port change from 25 to 587 problems Browsers & Mail


All times are GMT -5. The time now is 02:38 AM.


Seven Forums Android App Seven Forums IOS App Follow us on Facebook

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
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32