Question : I need to run a batch file located on a NAS remote drive using command prompt from a Java program. I tried below solution which is reading batch file from the remote location but executing it in my local as cmd.exe will be from my local.I need to know how to open a command prompt in remote windows server. Lets says my Remote windows server is : CTRD001
String[] command = {"cmd.exe ", "/C", "Start", "\\adgtc011\tfo25\test\test.bat"};
Process p = Runtime.getRuntime().exec(command);
Can I use something like %windir%\system32\cmd.exe to open on remote server but definitely with proper Path configuration.