0

Let's say my PC is A, and a remote one is B. Both are windows machines.

From A I start an executable that is on a shared location in PC B. Using the Process and ProcessStartInfo classes.

When the remote process tries to access the registry, it access PC A's registry, even though it runs on B.

I understand this is because I run the process from PC A remotely, but how can I access PC B's registry instead?

I've tried setting ProcessStartInfo.LoadUserProfile to true, no luck.

Thanks

  • 1
    Why do you think it would run on B just because the file is located there? B might e.g. be a Linux machine. – Klaus Gütter Aug 17 '20 at 15:45
  • Both are windows machine, added to the question. – Shahaf Nahmias Aug 17 '20 at 15:49
  • 2
    even if the exe is launched from a remote location, it will be a running process on the machine that executed it (PC A in your case) in the memory of the machine that executed it. It would be insecure to allow processes to access another machine other than the one that launched it. Depending on your needs, you may consider PowerShell remoting for accessing remote machines – Carl Aug 17 '20 at 15:55
  • 2
    Does not matter. You are loading a file from B into A's memory and starting it there. Imagine the security implications if it were the way you suppose. – Klaus Gütter Aug 17 '20 at 15:56
  • I understand, I will have to use a different approach then. Thank you both for good answers. – Shahaf Nahmias Aug 17 '20 at 15:59
  • You need to either use remote registry to access B's registry when running on A, or you can use [SysInternals psexec](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec) command to execute the program on B. – NetMage Aug 17 '20 at 18:55

0 Answers0