Click here to Skip to main content
15,917,328 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,

I have application that can copy and paste the font file in LAN machine's 'windows/fonts' directory, but the font file is not visible in the LAN machine because the lack of registry in the windows registry.

So I want to know how to set the font information in the systems registry from remote machine. So that the font can be installed properly from the server and can be usable by the user on LAN machine.

Thanks,
Sahil Banker
Posted

Which OS are you targeting? In XP there is registry key that points to the installed fonts

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]

I'm not sure if this keys is still valid in Vista/Win7.
 
Share this answer
 
Comments
Espen Harlinn 18-Jan-11 16:49pm    
5+ Looks like it's still used on Win7
I have never tried it, but System.Management namespace may help you access remote registry.

Here is a sample which may serve as bases. Ref[^]
VB
Sub remoteReg()
  Dim strComputerName As String = "REMOTE_PC_NAME"
  Dim strKeyPath As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" 
  Dim objManagementScope As ManagementScope
  Dim objManagementClass As ManagementClass
  Dim objManagementBaseObject As ManagementBaseObject

  objManagementScope = New ManagementScope
  objManagementScope.Path.Server = strComputerName
  objManagementScope.Path.NamespacePath = "root\default"
  objManagementScope.Options.EnablePrivileges = True
  objManagementScope.Options.Impersonation = ImpersonationLevel.Impersonate
  objManagementScope.Connect()

  objManagementClass = New ManagementClass("stdRegProv")
  objManagementClass.Scope = objManagementScope
  objManagementBaseObject = objManagementClass.GetMethodParameters("EnumKey")
  'here onwards objManagementBaseObject has GetPropertyValue and SetPropertyValue

End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900