Windows Service app is returning folder path C:\Windows\system32\ instead of project path

window application which is running windows service
It is providing


instead of folder path where I have placed config files and all.

I am using following code

	filePath,err := os.Getwd()

But expect project folder path.

Because your binary file is into “C:\Windows\system32”

I got the solution

package main

import (

func main() {
    folderPath, err := osext.ExecutableFolder()
    if err != nil {


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.