Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to programmatically change COM port FriendlyName

18 May 2010   #1
quantum1976

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
IggyAZ

Windows 7 Ultimate (32 bit)
 
 

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
quantum1976

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
ronsum

Windows 7 Ultimate x64
 
 

Try icacls.exe
My System SpecsSystem Spec
Reply

 How to programmatically change COM port FriendlyName




Thread Tools





Similar help and support threads
Thread Forum
Multiple copies of printer created - no change to USB/port
Hi - I have a Dell with a recent upgrade from Vista to Windows 7. Before and after the upgrade, most of the time I print, I end up with multiple copies of the printer and sometimes documents stuck in the print queue. HP F380 printer. This is a cabled computer (no wifi, BT). No other computers...
Hardware & Devices
How can I change line in port to microphone
hello guys I have one problem when I put the microphone cable in pc he read like a line in no like a microphone and line in I can't use like a microphone did you know how to change line in in the microphone or can I change the line in jack information to microphone jack info.. ...
Sound & Audio
change USB port numbers
Hello, I would appreciate suggestions for how to change USB port numbers both in Windows 7 Starter and in Windows 7 Home Premium. Windows XP makes this operation easy, but I have found no comparable method in Windows 7 Starter. Is the problem that I am using Starter? Can it be done in Home...
Hardware & Devices
Mute the audio mixer application programmatically
hello all, I try to mute/unmute the available application mixer individually (not the master sound). Does windows provided any API to get this thing done? Thanks for help...
Sound & Audio
How to disable sleep mode programmatically
I have a vb.net application that runs for several hours. The problem I am having is that Windows 7 goes to sleep while my application is running. I know I can manually disable the sleep mode, but I am hoping there is a way I can enable/disable the sleep mode from within my vb.net application. That...
General Discussion
Comcast port change from 25 to 587 problems
Comcast requested a move from port 25 to 587 for sending email. I made the changes and am confident that I have all the correct attributes check. I can receive mail but unable to send. I can send an receive mail at the comcast.net site. Comcast tech said it is a Windows problem. I have searched and...
Browsers & Mail

Our Sites

Site Links

About Us

Find 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 23:50.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App