Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change work Directory for Windows? #229

Open
DustOak opened this issue Jul 20, 2020 · 4 comments
Open

How to change work Directory for Windows? #229

DustOak opened this issue Jul 20, 2020 · 4 comments

Comments

@DustOak
Copy link

DustOak commented Jul 20, 2020

How to change work Directory for Windows?
Can I use WorkingDirectory?

My English is pool sorry。

@kardianos
Copy link
Owner

This is not possible in Windows. Sorry.

I suggest you use os.Executable() or other configuration file to get the starting directory.

@shanjunmei
Copy link

This is not possible in Windows. Sorry.

I suggest you use os.Executable() or other configuration file to get the starting directory.

It seems that the Windows Service Manager API supports the SetCurrentDirectory function, which can be used to implement the WorkingDirectory functionality in github.com/kardianos/service.

@shanjunmei
Copy link

This is not possible in Windows. Sorry.
I suggest you use os.Executable() or other configuration file to get the starting directory.

It seems that the Windows Service Manager API supports the SetCurrentDirectory function, which can be used to implement the WorkingDirectory functionality in github.com/kardianos/service.

https://serverfault.com/questions/114238/windows-service-can-i-configure-the-current-working-directory

@yudidi
Copy link

yudidi commented Sep 6, 2023

Any new solution about this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants