func relaunchElevated(cmd string) {
	verb := "runas"
	exe, _ := os.Executable()
	cwd, _ := os.Getwd()

	// Reconstruct arguments, drop launch-gui and tell the new process it should have been elevated.
	xargs := []string{"-launch-elev=true", "-launch-cmd=" + cmd}
	args := strings.Join(xargs, " ")

	verbPtr, _ := windows.UTF16PtrFromString(verb)
	exePtr, _ := windows.UTF16PtrFromString(exe)
	cwdPtr, _ := windows.UTF16PtrFromString(cwd)
	argPtr, _ := windows.UTF16PtrFromString(args)

	var showCmd int32 = 1 //SW_NORMAL

	err := windows.ShellExecute(0, verbPtr, exePtr, argPtr, cwdPtr, showCmd)
	if err != nil {
		log.Warnf("Failed to launch self as elevated %v", err)
	} else {
		onExit()
	}
}
// relaunchElevated launch another instance of the current process asking it to carry out a command as admin.
// If the function succeeds, it will quit the process, otherwise the function will return to the caller.
relaunchElevated launch another instance of the current process asking it to carry out a command as admin.
If the function succeeds, it will quit the process, otherwise the function will return to the caller.
// relaunchElevated launch another instance of the current process asking it to carry out a command as admin . // If the function succeeds it will quit the process otherwise the function will return to the caller .
func relaunchElevated(cmd string) {
	verb := "runas"
	exe, _ := os.Executable()
	cwd, _ := os.Getwd()
	xargs := []string{"-launch-elev=true", "-launch-cmd=" + cmd}
	args := strings.Join(xargs, " ")
	verbPtr, _ := windows.UTF16PtrFromString(verb)
	exePtr, _ := windows.UTF16PtrFromString(exe)
	cwdPtr, _ := windows.UTF16PtrFromString(cwd)
	argPtr, _ := windows.UTF16PtrFromString(args)
	var showCmd int32 = 1 
	err := windows.ShellExecute(0, verbPtr, exePtr, argPtr, cwdPtr, showCmd)
	if err != nil {
		log.Warnf("Failed to launch self as elevated %v", err)
	} else {
		onExit()
	}
}
func relaunchElevated ( cmd string ) { verb := " " exe , _ := os . Executable ( ) cwd , _ := os . Getwd ( ) xargs := [ ] string { " " , " " + cmd } args := strings . Join ( xargs , " " ) verbPtr , _ := windows . UTF16PtrFromString ( verb ) exePtr , _ := windows . UTF16PtrFromString ( exe ) cwdPtr , _ := windows . UTF16PtrFromString ( cwd ) argPtr , _ := windows . UTF16PtrFromString ( args ) var showCmd int32 = 1 err := windows . ShellExecute ( 0 , verbPtr , exePtr , argPtr , cwdPtr , showCmd ) if err != nil { log . Warnf ( " " , err ) } else { onExit ( ) } }
relaunchElevated launch another instance of the current process asking it to carry out a command as admin.
relaunchElevated launch another instance of the current process asking it to carry out a command as admin .
// Reconstruct arguments, drop launch-gui and tell the new process it should have been elevated. //SW_NORMAL