Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 12th, 2018 82 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. exec.Command("del", "c:\aaa.txt")
  2.    
  3. package main
  4.  
  5. import(
  6.     "fmt"
  7.     "os/exec"
  8. )
  9.  
  10. func main(){    
  11.     c := exec.Command("cmd", "/C", "del", "D:\a.txt")
  12.  
  13.     if err := c.Run(); err != nil {
  14.         fmt.Println("Error: ", err)
  15.     }  
  16. }
  17.    
  18. cmd := exec.Command("cmd", "/C dir").Output()
  19.    
  20. exec.Command("c:\del.bat").Run()
  21.    
  22. if c, err := exec.Command("cmd","/c","del","a.txt").CombinedOutput(); err != nil {
  23.         log.Fatal(err)
  24.     } else {
  25.         fmt.Printf("%sn", c)
  26.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top