Page MenuHomePhabricator

CHEMCAD7 main.go
ActivePublic

Authored by newellz2 on May 8 2017, 1:04 PM.
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)
}
}

Event Timeline

newellz2 created this object with visibility "Public (No Login Required)".