Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AD-Control-Golang
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶腾飞
AD-Control-Golang
Commits
c29b95e2
Commit
c29b95e2
authored
Jul 07, 2022
by
陶腾飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/07/7 v2.5.9
parent
b764cc38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
README.MD
+2
-1
public/win.go
+6
-6
No files found.
README.MD
View file @
c29b95e2
...
@@ -104,7 +104,8 @@
...
@@ -104,7 +104,8 @@
-
2022/04/29 v2.5.5 ci工具 自我升级
-
2022/04/29 v2.5.5 ci工具 自我升级
-
2022/05/26 v2.5.6 更新主要计算机功能bug修复
-
2022/05/26 v2.5.6 更新主要计算机功能bug修复
-
2022/06/14 v2.5.7 更新日志输出、删除情报一二三部
-
2022/06/14 v2.5.7 更新日志输出、删除情报一二三部
-
2022/06/29 v2.5.8 增加抖音组,解决walk的反射问题,优化软件安装的下载速度
-
2022/07/6 v2.5.8 增加抖音组,解决walk的反射问题,优化软件安装的下载速度
-
2022/07/7 v2.5.9 隐藏下载软件的窗口,
## 四、其他说明
## 四、其他说明
...
...
public/win.go
View file @
c29b95e2
...
@@ -162,7 +162,7 @@ func PSCommandOutput(cmd string) (string, error) {
...
@@ -162,7 +162,7 @@ func PSCommandOutput(cmd string) (string, error) {
if
cmd
==
""
{
if
cmd
==
""
{
return
""
,
Error_Lost_Parameter
return
""
,
Error_Lost_Parameter
}
}
cmd
=
"powershell -command "
+
cmd
cmd
=
"powershell -
windowstyle hidden -
command "
+
cmd
app
,
appargs
,
err
:=
execcmd_base
(
cmd
)
app
,
appargs
,
err
:=
execcmd_base
(
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
@@ -181,7 +181,7 @@ func PSCommandWait(cmd string) error {
...
@@ -181,7 +181,7 @@ func PSCommandWait(cmd string) error {
if
cmd
==
""
{
if
cmd
==
""
{
return
Error_Lost_Parameter
return
Error_Lost_Parameter
}
}
cmd
=
"powershell -command "
+
cmd
cmd
=
"powershell -
windowstyle hidden -
command "
+
cmd
app
,
appargs
,
err
:=
execcmd_base
(
cmd
)
app
,
appargs
,
err
:=
execcmd_base
(
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -201,7 +201,7 @@ func PSCommandWait(cmd string) error {
...
@@ -201,7 +201,7 @@ func PSCommandWait(cmd string) error {
// return strings.TrimSpace(string(out)), nil
// return strings.TrimSpace(string(out)), nil
}
}
func
PSCommandOutputNoSplit
(
cmd
string
)
(
string
,
error
)
{
func
PSCommandOutputNoSplit
(
cmd
string
)
(
string
,
error
)
{
cmd
=
"powershell -command "
+
cmd
cmd
=
"powershell -
windowstyle hidden -
command "
+
cmd
app
,
appargs
,
err
:=
execcmd_base
(
cmd
)
app
,
appargs
,
err
:=
execcmd_base
(
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
@@ -214,17 +214,17 @@ func PSCommandOutputNoSplit(cmd string) (string, error) {
...
@@ -214,17 +214,17 @@ func PSCommandOutputNoSplit(cmd string) (string, error) {
}
}
func
PSCommand
(
cmd
string
)
error
{
func
PSCommand
(
cmd
string
)
error
{
return
exec
.
Command
(
"powershell"
,
"-command"
,
cmd
)
.
Start
()
return
exec
.
Command
(
"powershell"
,
"-
windowstyle"
,
"hidden"
,
"-
command"
,
cmd
)
.
Start
()
}
}
func
PSFileOutputNoSplitRemoteSigend
(
file
string
)
([]
byte
,
error
)
{
func
PSFileOutputNoSplitRemoteSigend
(
file
string
)
([]
byte
,
error
)
{
return
exec
.
Command
(
"powershell"
,
"-executionPolicy"
,
"RemoteSigned"
,
"-File"
,
file
)
.
CombinedOutput
()
return
exec
.
Command
(
"powershell"
,
"-
windowstyle"
,
"hidden"
,
"-
executionPolicy"
,
"RemoteSigned"
,
"-File"
,
file
)
.
CombinedOutput
()
}
}
func
PSTest_Connection
(
host
string
)
(
bool
,
error
)
{
func
PSTest_Connection
(
host
string
)
(
bool
,
error
)
{
if
host
==
""
{
if
host
==
""
{
return
false
,
Error_Lost_Parameter
return
false
,
Error_Lost_Parameter
}
}
t
,
err
:=
exec
.
Command
(
"powershell"
,
"-command"
,
"Test-Connection"
,
host
,
"-quiet"
)
.
Output
()
t
,
err
:=
exec
.
Command
(
"powershell"
,
"-
windowstyle"
,
"hidden"
,
"-
command"
,
"Test-Connection"
,
host
,
"-quiet"
)
.
Output
()
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment