Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,

Is it possible to use rsh.exe directly though ASP.NET.

RSH is enabled on my machine. So I can use rsh through command prompt.
It even works in a bat file.

But id does not seem to work through C# code.

My understanding is that it is not meant for automation purposes.

Please throw more light on usage of RSH.exe from code.
Posted
Comments
Sergey Alexandrovich Kryukov 6-Nov-12 10:41am    
If does not matter if this is RSH.EXE or not -- you can write code which immediately runs of UNIX (depending on what kind of UNIX) -- please see my answer.
--SA
Sergey Alexandrovich Kryukov 6-Nov-12 10:42am    
"Not seem to work" is not informative. Either sort out this part by yourself or provide comprehensive information.
--SA

1 solution

You can do in on UNIX (at least, many UNIX-like systems) under Mono:
http://en.wikipedia.org/wiki/Mono_%28software%29[^],
http://www.mono-project.com/[^].

The method you would need is System.Diagnostics.Process.Start, please see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx[^].

In many cases, you can develop on Windows and run this code under Mono on a different OS without recompilation, if you code is platform-compatible. If you develop accurately, it's usually the case.

—SA
 
Share this answer
 
Comments
Ashok26 6-Nov-12 10:55am    
I am not supposed to use any open source code due to approval reasons.

So, I am trying to use existing rsh.exe through .NET.

Is it possible to trigger rsh.exe through process?
The problem I am facing is "The process keeps running and does not return any result."
Sergey Alexandrovich Kryukov 6-Nov-12 13:07pm    
I so, you are not working in proper team. Ask for help those who approve or disapprove things. By the way, these people probably don't know that you already do, perhaps indirectly.
And I already answered: use System.Diagnostics.Process.Start, that means, this is possible.
--SA
Ashok26 7-Nov-12 4:19am    
I am using System.Diagnostics.Process.
Everything works fine when I am using Visual Studio devleopment server.
When I use IIS, I get error as "remuser too long".

I am providing user id as arguments to process.
Sergey Alexandrovich Kryukov 7-Nov-12 12:39pm    
To see the difference, one would need to see your code...
--SA

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