I want to register the service in windows and after register wants to start also.
using following command in the code::
cmd.exe /C sc create "<service name>" binpath="D:\\abc\\xyz.exe -zglaxservice xyz"
I execute above command through runtime.exec()
.
upon running the code it gives the help of sc command.
Code ::
Process proc = null;
String[] cmdStr = new String[] { "cmd.exe","/C","sc", "create", "\""+servicename+"\"", "binpath= \"D:\\SCCode\\"+exeName+".exe -zglaxservice "+laxName+"\"" };
proc = Runtime.getRuntime().exec(cmdArr);
Please help...