Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# .NET
Below is my requirment-
I want to run two .bat file in remote machine using C#.Net. This two .bat file residing at remote machine.Like-
1. C:\aa\aa.bat and
2. D:\bb\bb.bat
After successfull run of aa.bat file, bb.bat file will be started and getting message after successful run.
Can someone please provide me the code? It's very urgent.
Posted 18-Nov-12 4:16am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you have access to the remote machine, and can reach and execute the files, then you can do it with Process.Start[^]
However, it will run the files on your machine, not on the remote machines processor, and at whatever privilege level and access rights your connection is permitted, no more. There are all sorts of things which are designed to prevent your running programs on other machines - firewalls for one.
ProgramFOX at 18-Nov-12 10:11am

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

  Print Answers RSS
0 OriginalGriff 230
1 PIEBALDconsult 150
2 DamithSL 125
3 BillWoodruff 108
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195

Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 18 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100