Jump to content
Fivecord

Starting Service app gives Error 2: The system cannot find the file specified

Recommended Posts

I created a Service application, put it in the System32 folder and installed it via /install.

Now when I want to start the service I get the error message Error 2: The system cannot find the file specified.

 

After finding no help in Google, I created and built a new Service application (thus an empty service project) and also put it in the System32 folder and installed it. When I started it I got the same error.
I have absolutely no idea which file can't be found.
Do I have a wrong setting somewhere in the project?

Anyone have an idea?

PS: I'm using Delphi 11 and Windows 10.

Share this post


Link to post

If your OS is 64 bit and you have a 32-bit service then search an other place like SysWOW64.

Edited by Cristian Peța

Share this post


Link to post

"On 64-bit versions of Windows, you have two separate Program Files folders. But it doesn’t end there. You also have two separate system directories where DLL libraries and executables are stored: System32 and SysWOW64. Despite the names, System32 is full of 64-bit files and SysWOW64 is full of 32-bit files. "

https://www.howtogeek.com/326509/whats-the-difference-between-the-system32-and-syswow64-folders-in-windows/

Share this post


Link to post
On 11/7/2021 at 7:17 AM, Fivecord said:

I created a Service application, put it in the System32 folder and installed it via /install.

Do NOT put non-system files in the System32 folder, they don't belong there.  You can install your service from your own folder just fine.

On 11/7/2021 at 7:49 AM, Fivecord said:

No, a 32-bit service app

On a 64bit Windows, the System32 folder is for 64bit files only.  32bit files would have to go in the SyWOW64 folder instead.  But again, don't put your service app in either folder to begin with.

Edited by Remy Lebeau

Share this post


Link to post

FWIW: We have several 32-bit services. There is no reason what so ever to put them in one of the Systems folders.

Share this post


Link to post

Hi Guys,

I'm will definitely not put the service in the System-folder! 😉

I learned my lesson thanks to you guys!

Gtrz

Share this post


Link to post

The appropriate place would be something like

\Program Files (x86)\<Your Company or System Name>\<Services>\YourServiceHere.exe

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×