Created
December 7, 2017 12:25
-
-
Save BLTSEC/bc8518cea448c6a6a1ffbb3380230815 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os/exec" | |
"path/filepath" | |
"strings" | |
) | |
func main() { | |
// replaces each '/' with the appropriate path separator | |
path := filepath.FromSlash("C:/Users/BLTSEC/Desktop/script.sql") | |
cmd := "cmd /C echo exit | sqlplus USERNAME/PASSWORD@TNS_NAME @" + path | |
parts := strings.Fields(cmd) | |
head := parts[0] | |
parts = parts[1:len(parts)] | |
c := exec.Command(head, parts...) | |
if err := c.Run(); err != nil { | |
fmt.Println("Error: ", err) | |
} | |
} | |
// Cradle to hide cmd window | |
// save in a vbs file | |
// | |
// Set oShell = CreateObject ("Wscript.Shell") | |
// Dim strArgs | |
// strArgs = "cmd /c .\GOBINARY.exe" | |
// oShell.Run strArgs, 0, false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment