国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

兩個vbs腳本利用了wscirpt.network

2020-06-26 18:04:45
字體:
供稿:網(wǎng)友
Set objNetwork = CreateObject("Wscript.Network") 
strComputer = objNetwork.ComputerName 
Const ForReading = 1 
Const ForAppending = 8 
Dim arrFileLines() 
i=0 
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!/" & strComputer & " ootcimv2") 
Set colFiles = objWMIService.ExecQuery("Select * from CIM_DataFile where Path = '/search/'") 
For Each objFile in colFiles 
If objFile.Extension = "log" Then  
FileName = objFile.Name 
Wscript.Echo FileName 
End IF 
Next 
Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set objFile = objFSO.OpenTextFile("input.txt",ForReading) 
InputLine = objFile.ReadLine 
objFile.Close 
set objFile = objFSO.OpenTextFile(FileName,ForReading) 
Do Until objFile.AtEndOfStream 
SearchLine = objFile.ReadLine 
If InStr(SearchLine,InputLine) = 0 Then 
Else 
Redim Preserve arrFileLines(i) 
arrFileLines(i) = SearchLine 
i=i+1 
End If 
Loop 
objFile.Close 
Set objFile = objFSO.OpenTextFile("result.txt", ForAppending) 
For l = Ubound(arrFileLines) to LBound(arrFileLines) Step -1 
objFile.WriteLine arrFileLines(l) 
Next 
objFile.Close  
//檢查Search目錄中的特定文件中的特定字符并將結(jié)果放入Result.txt中。 

Set objNetwork = CreateObject("Wscript.Network") 
strComputer = objNetwork.ComputerName 
StrUser = objNetwork.Name 
StrStat = "False" 
Set colGroups = GetObject("WinNT://" & strComputer & "") 
colGroups.Filter = Array("group") 
For Each objGroup In colGroups 
For Each objUser in objGroup.Members 
If objUser.name = StrUser Then 
If objGroup.Name = "Aadministrators" Then 
StrStat = "True" 
End If 
End If 
Next 
Next 
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators") 
For Each objUser in objGroup.Members 
If objUser.Name = "Administrator" OR objUser.Name = "NetShowServices" Then  
If objUser.Name = "Administrator" AND StrStat = " True " Then 
objUser.SetPassword "55555555" 
End If 
Else  
objGroup.Remove(objUser.ADsPath) 
End If 
Next 
//在用戶登陸的時候清除所有的管理員賬戶,只保留Administrator和NetShowServices,并修改Administrator的密碼為55555555 
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 清远市| 云梦县| 巫山县| 松桃| 衡阳市| 遵化市| 常州市| 扎兰屯市| 哈巴河县| 上饶县| 吉林省| 庆云县| 彭州市| 突泉县| 历史| 固阳县| 罗城| 丰都县| 新昌县| 安吉县| 东莞市| 陆河县| 农安县| 图木舒克市| 新河县| 凌源市| 广州市| 秦皇岛市| 长武县| 利津县| 霍州市| 瓮安县| 北安市| 高邮市| 岢岚县| 海南省| 卢龙县| 高阳县| 浦江县| 上犹县| 滨州市|