We help IT Professionals succeed at work.

How to run a batch file on a remote computer from vb.net

DoubtMan
DoubtMan used Ask the Experts™
on
Hi,
Can somebody provide me the correct script to run a batch file located on a remote computer for vb.net?

Scenario:
I am running a vb.net command line tool from ComputerA, that should execute the batch file located on a remote computer ComputerB

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
You could look at the PSTools Suite.  PSExec allows you, with sufficient rights, to execute on a remote computer.
Most Valuable Expert 2012
Top Expert 2014

Commented:
And here is the direct download link for PSExec

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Author

Commented:
Unfortunately no one had provided me a vb.net solution using PSExec. Though I know that PSEexec work, I cant get that working from a .net application. I can run the same one line command from a dos comamnd prompt. However, when I use it in .net using process, it simply hangs and does nothing..

Apriciate if somebody can look into it.

Cheers.
Most Valuable Expert 2012
Top Expert 2014
Commented:
Do you pass arguments separately? Show us the code that you have

http://anyrest.wordpress.com/2010/05/24/execute-applications-on-remote-systems/

Author

Commented:
Thanks. Thats the code what I wanted.

Cheers.