batch file - installing windows service from command line "The specified service has been marked for deletion" -
i trying create batch file automate uninstalling, building , reinstalling windows service. after uninstalling when try reinstall error: specified service has been marked deletion.
here batch script:
@echo off set filepath=<myfilepath> set servicename=<myservicename> sc query %servicename% > nul if %errorlevel% equ 0 net stop %servicename% & sc delete %servicename% c:\windows\microsoft.net\framework64\v4.0.30319\msbuild.exe c:\users\christopher\desktop\tfs\moc\laneupdateservice\laneupdateservice.sln /property:configuration=debug c:\windows\microsoft.net\framework64\v4.0.30319\installutil.exe %filepath% sc start %servicename%
i not have task manager, services or event viewer open, there no other users logged in. have tried deleting reg key service, no luck. if run script again after failing install correctly. there way manually make sure service deleted?
the problem after stopping service there still process running. altered onstop method make sure processes stopped correctly. batch file works correctly. @harry johnston suggested adding while loop batch file.
Comments
Post a Comment