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

x/sys/windows/registry: the system cannot find the file specified #32965

Closed
Dontmindmes opened this issue Jul 6, 2019 · 3 comments
Closed

x/sys/windows/registry: the system cannot find the file specified #32965

Dontmindmes opened this issue Jul 6, 2019 · 3 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@Dontmindmes
Copy link

Dontmindmes commented Jul 6, 2019

func main() {
	path := fmt.Sprintf("C:\\Test\\test\\test.exe")

	key, _, err := registry.CreateKey(registry.CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", registry.ALL_ACCESS)
	if err != nil {
		fmt.Println(err)
	}
	defer key.Close()

	err = key.SetStringValue("ProjectTest", path)
	if err != nil {
		fmt.Println(err)
	}

	err = registry.DeleteKey(key, "ProjectTest")
	if err != nil {
		fmt.Println(err)
	}

}

When delete key is ran it throws the error The system cannot find the file specified.

@mvdan
Copy link
Member

mvdan commented Jul 7, 2019

Why is this a Go bug? This is most likely an issue in your code, or in the "registry" library you're using. This issue tracker is only for bugs in Go itself.

@mvdan mvdan added Question WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jul 7, 2019
@kardianos
Copy link
Contributor

@mvdan The issue is vague, but it is most likely using https://godoc.org/golang.org/x/sys/windows/registry so this is the correct issue tracker.

@Dontmindmes I would recommend you do the following to your code: In the "if err != nil {" handler, don't call fmt.Println, call log.Fatalf("failed to delete key: %v", err)

There is very likely some bug in your code.

@kardianos kardianos changed the title The system cannot find the file specified. x/sys/windows/registry: the system cannot find the file specified Jul 8, 2019
@gopherbot gopherbot added this to the Unreleased milestone Jul 8, 2019
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Aug 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants