In Windows 7 I used the following method to start a Windows service in Java:
static final String CMD_START = "cmd /c net start \"";
public static int startService(String serviceName) throws Exception {
return execCmd(CMD_START + serviceName + "\"");
}
However, after I upgraded to Windows 10 this method no longer works. Could you help me with a code that starts a Windows service and works on Windows 10?