[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 538
  • Last Modified:

C#: execute code remotely

I need some samples/references of remote code execution.

Thanks
0
gromul
Asked:
gromul
  • 4
  • 3
1 Solution
 
DarkoLordCommented:
What do you mean by remote code execution?
0
 
gromulAuthor Commented:
Executing some code on a remote server (i.e. ftp://...)
0
 
DarkoLordCommented:
I'm not sure if you want to execute a C# code on a remote machine or execute an external program on a remote machine using C#? It would be a lot easier to advise if you explain exactly what you are trying to accomplish.

If the machine is on the same network, you can use a tool such as PsExec (http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx) which allows you to execute programs on a remote machine (provided you have necessary permissions).

You can also execute files via FTP, however the FTP server needs to be configured to allow executing applications via FTP for a specified user, and you need a FTP client which supports that (such as FlashFXP, for example). This way is not really recommended though.

Regards,
Darko
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
gromulAuthor Commented:
I want to execute some code on a remote machine from my C# code. Something like this for example:

Copy an executable to the remote machine (already got this with FTP)
Execute the copied executable: i.e. executable.exe [some parameters]
0
 
DarkoLordCommented:
What kind of access do you have to the remote machine (besides FTP)?
0
 
gromulAuthor Commented:
I have full access, but I want to automate deployment and do it through the C# code.
0
 
DarkoLordCommented:
Okay, check these:
 - http://www.thescripts.com/forum/thread266944.html (the code in the first post)
 - http://www.codeproject.com/csharp/run_code_remotely.asp (also copies the file to the remote machine)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now