executor_windows.go 497 B

123456789101112131415161718192021222324
  1. //go:build windows
  2. // +build windows
  3. package executor
  4. import (
  5. "context"
  6. "os"
  7. "os/exec"
  8. )
  9. func (e *Executor) Kill(execReq *InternalLogEntry) error {
  10. return execReq.Process.Kill()
  11. }
  12. func wrapCommandInShell(ctx context.Context, finalParsedCommand string) *exec.Cmd {
  13. winCodepage := os.Getenv("OT_WIN_FLAG_U")
  14. if winCodepage == "0" {
  15. return exec.CommandContext(ctx, "cmd", "/C", finalParsedCommand)
  16. } else {
  17. return exec.CommandContext(ctx, "cmd", "/u", "/C", finalParsedCommand)
  18. }
  19. }