exec

package
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdWithoutWindow

func CmdWithoutWindow(name string, args ...string) *exec.Cmd

func GetLocalLangLoc

func GetLocalLangLoc(defaultLang, defaultLoc string) (string, string)

GetLocalLangLoc Get-Culture List: http://www.codedigest.com/CodeDigest/207-Get-All-Language-Country-Code-List-for-all-Culture-in-C---ASP-Net.aspx Chinese (Singapore) zh-SG Chinese (People's Republic of China) zh-CN Chinese (Hong Kong S.A.R.) zh-HK Chinese (Macao S.A.R.) zh-MO English (United States) en-US Japanese (Japan) ja-JP

func IsSingleInstance

func IsSingleInstance(curExeName string) bool

func IsTaskRunning

func IsTaskRunning(exeName string) bool

func ListenToDelete

func ListenToDelete(ch chan string, cbFunc func(string, error))

ListenToDelete Send the file path which you want to delete to the channel, and then it will start another process by Powershell to delete the file. If you want to delete the executable (self), you can send os.Args[0] "ch" 正常而言您不需要透過此函數來刪除檔案,僅需要`os.Remove()`即可。 此函數的特色:能刪除掉自身執行檔 如果您選擇的是刪除自身執行檔,那麼callbackFunc,不應該寫得太複雜,因為結束動作是直接打開powershell運行, 因此當您的callback要花很多時間,有可能還沒跑完就刪除了

func TaskKill

func TaskKill(exeName string) error

TaskKill 強制關閉程式, 可透過tasklist查看task清單

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL