Tag:Remote script

  • Rcmd.vbs [remote CMD with WMI] remote script

    Time:2020-3-19

    Copy codeThe code is as follows: On Error Resume Next Set outstreem=Wscript.stdout If (LCase(Right(Wscript.fullname,11))=”Wscript.exe”) Then Set objShell=Wscript.CreateObject(“Wscript.shell”) objShell.Run(“cmd.exe /k cscript //nologo “&Chr(34)&Wscript.ScriptFullName&Chr(34)) Wscript.Quit End If If Wscript.arguments.Count<4 Then usage() Wscript.echo “Not enough Parameters.” Wscript.Quit End If ip=Wscript.arguments(0) username=Wscript.arguments(1) password=Wscript.arguments(2) CmdStr=Wscript.arguments(3) EchoStr=Wscript.arguments(4) foldername=”c:\\windows\\temp\\” wsh.echo “Conneting “&ip&” ….” Set objlocator=CreateObject(“wbemscripting.swbemlocator”) Set objswbemservices=objlocator.connectserver(ip,”root/cimv2″,username,password) showerror(err.number) Set Win_Process=objswbemservices.Get(“Win32_ProcessStartup”) Set Hide_Windows=Win_Process.SpawnInstance_ […]