Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Across network, where does SetRegKeyValue write?

Status
Not open for further replies.

bluecrush

Programmer
Mar 26, 2004
61
US
I was wondering if someone can verify or refute my understanding:

I have an app that resides on Computer A and is executed across the network from Computer B. If MyApp reads/writes to the registry, which computer's registry will be accessed? My understanding is that even though the EXE resided on Computer A, when it is run across the network it will read/write the registry of Computer B.

If this understanding is correct, then I have a follow-up question:

Is there a way to force MyApp to read/write the registry of the computer on which the EXE resides rather than the registry of the computer from which the EXE is being accessed?

Thank you in advance for any insight you can provide!
 
Every application on Win NT/2K/XP can read/write registry on both computers (A and B in Your sample), if it (or user started it) has enough rights. With API RegConnectRegistry() You can force application to access registry on computer You needs. To find out, if exe is local or resided on another computer, You can use GetComputerName() and GetCurrentDirectory(). GetCurrentDirectory() give You the path to exe-file. To become name of remote PC from this path, You can use WNetGetConnection() and then compare server name with name of computer where allpication is rinning.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top