Can we execute a Windows run command from an Android device? Like for example I want to open a file in PC using my Android device such as Run>C:\abc.exe
.
Or you can say I want to run a batch process (Exe File) placed in PC from my Android device.
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.
Sign up to join this communityCan we execute a Windows run command from an Android device? Like for example I want to open a file in PC using my Android device such as Run>C:\abc.exe
.
Or you can say I want to run a batch process (Exe File) placed in PC from my Android device.
One option would be to install and set up SSH on the target PC. http://sshwindows.sourceforge.net/
You can then use any of the many SSH android clients to connect to the target PC and you will have command line access.
I think we can achieve this thing using Sockets. we need to send a command from device to PC using socket. But on PC side we must have another socket which can manipulate the incomming command from device .Then we can execute exe batch or jar file on the basis of incomming string.
Like that suppose we send a command from device to pc " Java -jar " C:\deviceExecute.jar " On pc side we get this command through socket as a string (executejar) and then run this
if(executejar!=null || executejar!="") {
Runtime runtime = Runtime.getRuntime(); Process proc = runtime.exec(executejar);
}