bin\servicedirectory; use an x64 file explorer so that the x64 service wrapper will be launched.
At a command prompt enter
service installand press Enter. The service is now installed but need to be manually configured for Automatic start-up.
Note for WildFly 10:
bin\servicedirectory doesn't exist any more, it's content was moved in
docs\contrib\scripts\service; the above described procedure is still valid but
servicemust be copied to
binbefore applying it.