##k.k## -7 Newbie Poster

Hello All,

I am copying file from one machine to another machine
after that execute that file on remote computer using c#.

I am using below command to copy file
File.Copy(sourcePath, DestinationPath, true);

and

ManagementClass remote_Class = new ManagementClass ("\\machineName\root\\cimv2:Win32_Process");
object[] remoterun = { destPathwithFileName, null, null, 0 };
remote_Class.InvokeMethod("Create", remoterun);

to execute that executable on remote machine.

Now I code in which I can provide domain\username and password.
I want that process to be executed by domain user on remote machine
Or process to be executed by username and password which I've provided in code.

I don't want to use LogOnUser()