package main import ( "golang.org/x/sys/windows/registry" "log" "os/exec" ) func main(){ k, err := registry.OpenKey(registry.CURRENT_USER, "Software", registry.QUERY_VALUE) if err != nil { log.Fatal(err) } defer k.Close() key, _, err := registry.CreateKey(k, `Chemstations\CHEMCAD 7\Authorization\specified_servers\license.engr.unr.edu`, registry.CREATE_SUB_KEY) if err != nil { log.Fatal(err) } defer key.Close() key, _, err = registry.CreateKey(k, `Chemstations\CHEMCAD 7\Authorization\specified_servers\license.engr.unr.edu\Superpro`, registry.CREATE_SUB_KEY) if err != nil { log.Fatal(err) } defer key.Close() key, _, err = registry.CreateKey(k, `Chemstations\CHEMCAD 7\Authorization\specified_servers\license.engr.unr.edu\Superpro`, registry.WRITE) if err != nil { log.Fatal(err) } key.SetStringValue("last_use", "2017-04-28T15:18:14-07:00") defer key.Close() cmd := exec.Command(`C:\Program Files (x86)\Chemstations\CHEMCAD 7\CC7.exe`) err = cmd.Start() if err != nil { log.Fatal(err) } }