windowsexec

package
v0.0.0-...-5c79d48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	// SEE_MASK_NOCLOSEPROCESS (0x00000040):
	// Use to indicate that the hProcess member receives the process handle.
	// This handle is typically used to allow an application to find out when a
	// process created with ShellExecuteEx terminates. In some cases, such as
	// when execution is satisfied through a DDE conversation, no handle will be
	// returned. The calling application is responsible for closing the handle
	// when it is no longer needed.
	SEE_MASK_NOCLOSEPROCESS = 0x40
)

These consts are copied verbatim from https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shellexecuteinfow

Variables

This section is empty.

Functions

func RunAsAndWait

func RunAsAndWait(
	file, directory string, timeout time.Duration, parameters []string,
) error

RunAsAndWait uses `ShellExecuteExW` to create a new process with elevated privileges on Windows. It waits for the process to exit, or until timeout, is exhausted. It will return an error if the process exits with a non-zero status code.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL