4

I need to execute a program directly from a remote computer, due to their system of network licensing they have with the program..
You install and register it once on a server and all clients access it through the network share by opening the executable. I wrote a little application that should make it easy to gain access to the network share and open the program.

No problem up to this point. I'm able to execute the program just like this, and it opens. Yay

// Some cred and network stuff.
// ...
Process.Start("\\192.168.0.100\Share\MyProgram.exe");

But the program pops up with a message, that the program may have been copied. It's like it has been executed locally.

This problem doesn't occur if I open the program through the explorer, just by opening it this way => \\192.168.0.100\Share\MyProgram.exe.

Does Process.Start() store files, that are opened remotely, locally on the machine (temporarily)? And if it does, is there a way around?

Additional infos:
Q: Some may think, why go through so much trouble for this, if you could just create a shortcut on your desktop? Or why not make a batch file?
A: IMO, it's easier to obscure credentials in c#. The access to the network share should only be given, if necessary. And that is only necessary when somebody wants to use the program.

Vincent
  • 1,459
  • 15
  • 37
MrMAG
  • 1,194
  • 1
  • 11
  • 34

1 Answers1

1

No, it doesn't. It does load the file in memory though, but that is the same for every program you start.

You can try this yourself with a simple console app:

static void Main(string[] args)
{
    Console.WriteLine(typeof(Program).Assembly.Location);
    Console.ReadKey();
}

This prints \\someserver\temp\ConsoleApplication8.exe here.

The program you mention can have some checks on the computer name for example to check if it was copied. I suggest to check Process Monitor to see if it creates / reads a file that contains the 'last used computer name' or something similar. I just tried it myself with the console app, but nothing pointing to the file being copied.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
  • I doubt. Check `typeof(Program).Assembly.Location`; codebase is different and assembly location is different. codebase is where the assembly is found not what being used – Sriram Sakthivel Jan 27 '15 at 12:08
  • @SriramSakthivel: Still the same. Updated the post to use `Location`. – Patrick Hofman Jan 27 '15 at 12:09
  • Thank your for the code snippet. I tried it by myself too. Will have to look deeper into it with ProcMon maybe. *Curious* – MrMAG Jan 27 '15 at 12:19