Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1
CHEMCAD7 main.go
Active
Public
Actions
Authored by
newellz2
on May 8 2017, 1:04 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
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 paste.
May 8 2017, 1:04 PM
2017-05-08 13:04:01 (UTC-7)
newellz2
created this object with visibility "Public (No Login Required)".
Log In to Comment