Commit 59c6b5c4 by 陶腾飞

update

parent b2ffa4ef
@echo off
rsrc -manifest AD-Control.manifest -o AD-Control.exe.syso
copy /y AD-Control.exe.syso ..\AD-Control-Deamon\AD-Control-Deamon.exe.syso
copy /y AD-Control.exe.syso ..\AD-Control-Users\AD-Control-Users.exe.syso
pause
\ No newline at end of file
package main
import (
"fmt"
"log"
registry "github.com/golang/sys/windows/registry"
)
func main() {
installListPath := [2]string{`SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall`,`SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall`}
for _,ilp := range installListPath{
k, kerr := registry.OpenKey(registry.LOCAL_MACHINE,ilp, registry.READ)
if kerr != nil {
log.Fatal(kerr)
}
defer k.Close()
il,ilerr := k.ReadSubKeyNames(0)
if ilerr != nil{
log.Fatal(ilerr)
}
for _,each := range il{
subil := ilp + `\` + each
sk, skerr := registry.OpenKey(registry.LOCAL_MACHINE,subil, registry.READ)
if skerr != nil{
fmt.Print(skerr)
}
dn, _, skerr := sk.GetStringValue("DisplayName")
us, _, userr := sk.GetStringValue("UninstallString")
if skerr != nil || userr!=nil{
continue
}
fmt.Printf("%s,%s\n", dn,us)
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<asmv1:assemblyIdentity name="AD-Control-Users..exe" version="0.0.0.1" publicKeyToken="0000000000000000" language="非特定语言" processorArchitecture="msil" type="win32" />
<description asmv2:publisher="知微" asmv2:product="域控制中心" xmlns="urn:schemas-microsoft-com:asm.v1" />
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True</dpiAware>
</windowsSettings>
</application>
</assembly>
\ No newline at end of file
package main
import(
"os/exec"
"fmt"
"golang.org/x/text/encoding/simplifiedchinese"
)
func main() {
cmd,err := exec.Command("whoami","/fqdn").Output()
if err !=nil {
fmt.Print(err)
}
gbk,err := simplifiedchinese.GBK.NewEncoder().Bytes([]byte(cmd))
if err !=nil {
fmt.Print(err)
}
return string(gbk)
}
@echo off
copy /y daemon\daemon.exe \\adserver\software\application
copy /y users\Users.exe \\adserver\software\application
pause
\ No newline at end of file
taskkill /f /im users.exe
go build -ldflags="-H windowsgui"
start ./users.exe
\ No newline at end of file
@echo off
cd C:\Users\Administrator\go\src\AD-Control\users
rsrc -manifest .\users.exe.manifest -ico ..\public\AD-Control.ico -o .\users.exe.syso
pause
\ No newline at end of file
taskkill /f /im users.exe
taskkill /f /im daemon.exe
start .\users.exe
start ..\daemon\daemon.exe
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment