Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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.

share|improve this question
2  
Why don't you try remote desktop? –  roxan Apr 11 '12 at 13:25
    
Please don't just throw every version tag onto your questions. It is not the purpose of the tagging system. –  eldarerathis Apr 11 '12 at 13:27
add comment

2 Answers

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);

}

share|improve this answer
2  
Welcome to Android Enthusiasts! Note that this site is intended for Android (power) users, not programmers, so please only provide answers that do not involve creating your own program. –  THelper Feb 14 '13 at 12:56
add comment

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.

share|improve this answer
1  
This is a dangerous advice: SSH Windows is positively ancient (7 years since the latest release, for a critical piece of software) and unsupported. Better alternatives exist, and Wikipedia lists most of them. –  Martin Tapankov Apr 11 '12 at 14:40
    
Good point, if you want this to be accessible from outside your home network, you certainly should seek an up to date option. –  Brandorf Apr 11 '12 at 15:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.