主頁 > 知識庫 > Rcmd.vbs [Remote Cmd with wmi]遠(yuǎn)程腳本

Rcmd.vbs [Remote Cmd with wmi]遠(yuǎn)程腳本

熱門標(biāo)簽:百度地圖標(biāo)注怎么卸載 前鋒辦理400電話申請 外呼營銷下單系統(tǒng) 加盟電銷機器人好的品牌 辦理膠州400電話財稅 陜西高頻外呼回?fù)芟到y(tǒng)哪家好 海外美發(fā)店地圖標(biāo)注 新密防封卡外呼系統(tǒng)違法嗎 打電話的外呼系統(tǒng)貴不貴
復(fù)制代碼 代碼如下:

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.ScriptFullNameChr(34))
Wscript.Quit
End If
If Wscript.arguments.Count4 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_
Hide_Windows.ShowWindow=12
Set Rcmd=objswbemservices.Get("Win32_Process")
Set colFiles = objswbemservices.ExecQuery _
("Select * from CIM_Datafile Where Name = '"foldername"read.vbs'")
If colFiles.Count = 0 Then
wsh.echo "Not found read.vbs! Create Now!"
Create_read()
End If


If EchoStr = "0" Then
msg=Rcmd.create("cmd /c "CmdStr,Null,Hide_Windows,intProcessID)
Else
msg=Rcmd.create("cmd /c cscript %windir%\temp\read.vbs """CmdStr"""",Null,Hide_Windows,intProcessID)
End If

If msg = 0 Then
wsh.echo "Command success..."
Else
showerror(Err.Number)
End If

wsh.echo "Please Wait 3 Second ...."
wsh.sleep(3000)
Set StdOut = Wscript.StdOut
Set oReg=objlocator.connectserver(ip,"root/default",username,password).Get("stdregprov")
oReg.GetMultiStringValue H80000002,"SOFTWARE\Clients","cmd" ,arrValues
wsh.echo String(79,"*")
wsh.echo cmdstrChr(13)Chr(10)
'wsh.echo arrvalues
For Each strValue In arrValues
StdOut.WriteLine strValue
Next
oReg.DeleteValue H80000002,"SOFTWARE\Clients","cmd"

Sub Create_read()
RunYN =Rcmd.create("cmd /c echo set ws=WScript.CreateObject(^""WScript.Shell^"")> %windir%\temp\read.vbs"_
"echo str=ws.Exec(^""cmd /c ^""^wscript.arguments(0)).StdOut.ReadAll:set ws=nothing>> %windir%\temp\read.vbs"_
"echo Set oReg=GetObject(^""winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv^"")>> %windir%\temp\read.vbs"_
"echo oReg.SetMultiStringValue ^H80000002,^""SOFTWARE\Clients^"",^""cmd^"",Array(str) >> %windir%\temp\read.vbs",Null,Hide_Windows,intProcessID)
If RunYN = 0 Then
wsh.echo "read.vbs Created!!!"
Else
showerror(Err.Number)
End If

End Sub

Function showerroronly(errornumber)
If errornumber Then
wsh.echo "Error 0x"CStr(Hex(Err.Number))" ."
If Err.Description > "" Then
wsh.echo "Error Description: "Err.Description"."
End If
Wscript.Quit
Else
outstreem.Write "."
End If
End Function


Sub usage()
wsh.echo string(79,"*")
wsh.echo "Rcmd v1.01 by NetPatch"
wsh.echo "Usage:"
wsh.echo "cscript "wscript.scriptfullname" targetIP username password Command"
wsh.echo "cscript "wscript.scriptfullname" targetIP username password Command 0 //No echo"
wsh.echo string(79,"*")vbcrlf
end Sub
您可能感興趣的文章:
  • VB中使用WMI獲取系統(tǒng)硬件和軟件有關(guān)信息
  • VBS調(diào)用WMI遍歷搜索硬盤文件并計數(shù)的方法
  • vbs通過WMI修改文件文件夾的NTFS權(quán)限
  • WMI StdRegProv 通過wmi操作注冊表的vbscript實現(xiàn)代碼 (本地或遠(yuǎn)程)
  • VBS通過WMI監(jiān)視注冊表變動的代碼
  • VBS通過WMI獲取CPU使用率的代碼
  • 將WMI中的DateTime類型轉(zhuǎn)換成VBS時間的函數(shù)代碼
  • VBS調(diào)用WMI實現(xiàn)搜索硬盤mp3文件
  • VBS調(diào)用WMI快速關(guān)閉IE的腳本
  • VBS腳本使用WMI操作注冊表的代碼
  • vbs wmi獲取電腦硬件信息實例
  • 初窺WMI_Vbs腳本編程簡明教程補充讀物
  • 使用WMI得到計算機的信息

標(biāo)簽:梅州 伊春 河南 咸陽 阜陽 牡丹江 四平 武威

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Rcmd.vbs [Remote Cmd with wmi]遠(yuǎn)程腳本》,本文關(guān)鍵詞  Rcmd.vbs,Remote,Cmd,with,wmi,遠(yuǎn)程,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Rcmd.vbs [Remote Cmd with wmi]遠(yuǎn)程腳本》相關(guān)的同類信息!
  • 本頁收集關(guān)于Rcmd.vbs [Remote Cmd with wmi]遠(yuǎn)程腳本的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章