Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
want to execute cmd command with arguments in my .NET Core application. The problem is that I have to call it in external computer. I now IP, user, password of VM, the command that's needed to execute and its arguments. However I have trouble finding how to actually do it.

What I have tried:

I found example for .NET framework How to execute a command in a remote computer? but I've read that
using System.Management;
has not been migrated from .net framework to .net core. Is there other alternative how to do that?
Posted
Updated 24-May-20 11:59am
Comments
Maciej Los 25-May-20 4:22am    
Why do you need to execute command on remote computer?

1 solution

I don't think you have any options to that in .NET Core.

The System.Management namespace will only work on Windows.

Now, if the Process you want to start is an interactive one, meaning you're expecting the process to show up on the desktop of the user logged into the remote machine, that's not going to happen. You cannot start an interactive process remotely because it would be a huge security risk. The process would still start, but it'll just sit there forever, waiting for input that will never show up.
 
Share this answer
 
Comments
Maciej Los 25-May-20 4:18am    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900