Today I ran into a strange scenario, there was a need to create a batch file which will create a service.
Now the problem is service installation path was unknown to me and for any service to install it needs to its executable’s absolute path.
After doing some hit & trial and googling, came across the solution:
ECHO “Creating some service”
sc create someService binPath= %CURRENT_DIR%”\someService.exe” start= demand obj= password=
Hope this helps!!