In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shares information about how VBS scripts implement GUI graphical interfaces and log cleanup. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
How to use: save the following code as rizhi.vbs double-click to run, if not may be a problem with antivirus software. You can search. Solutions have been provided before.
set ie=wscript.createobject ("internetexplorer.application","event_") 'Create ie object' ie.menubar=0 'Cancel menu bar' ie.addressbar=0 'Cancel address bar' ie.toolbar=0 'Cancel toolbar' ie.statusbar=0 'Cancel status bar' ie.width=400 'width = 400' ie.height=400 'height =0 ' user is not allowed to change window size ' ie.navigate "about: blank "'Open a blank page ' ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2) ' horizontally centered ' ie.top =fix((ie.document.parentwindow.screen.availheight-ie.height)/2) ' vertically centered ' ie.visible=1 ' window visible ' with ie.document ' Call the [xss_clean] method,' .write''write a paragraph of html into the ie window. ' .write "Remotely clear system logs
" .write "
Target IP: " 'You can also open a' .write 'directly with the navigate method
User name: 'html files, the effect is the same. ' .write "
Password: " .write " Type: " 'Not only input object, all DHTML objects supporting' .write " application "'and their attributes and methods can be used. ' .write "system" .write "security" ' ways to access these objects and access ' .write "in web pages
"" The objects within the frame are similar. ' .write " " .write "" .write "" end with dim wmi ' explicitly defines a global variable ' set wnd=ie.document.parentwindow ' sets wnd to window object ' set id=ie.document.all ' sets id to collection of all objects in document 'id. confirm.onclick=getref ("confirm") 'set handler' id.cancel.onclick=getref("cancel") 'set handler' do while true 'when click' cancel 'Since ie objects support events, the corresponding,' wscript.sleep200 'script waits for various events in an infinite loop. ' loop sub event_onquit 'ie exits event handling ' wscript.quit ' When ie exits, the script also exits ' end sub cancel '"cancel 'event handling' ie.quit 'calls ie's quit method, closes IE window' end sub 'then triggers event_onquit, so the script also exits' sub confirm '" OK "event handling, which is key' with id if .ip.value="" then .ip.value=". "'Empty ip value defaults to local operation ' if not (.app.checked or .sys.checked or .sec.checked) then 'app, etc. are checkboxes, and whether they are selected is determined by checking their checked' wnd.alert("Select at least one log") ' attribute. ' exit sub end if set lct=createobject ("wbemscripting.swbemlocator") 'create server locator object' on error resume next 'cause script host to ignore nonfatal errors' set wmi=lct.connectserver (.ip.value,"root/cimv2",.user.value,.pass.value) 'connect to root/cimv2 namespace' if err.number then 'catch errors yourself and handle' wnd.alert ("Failed to connect to WMI server") 'Here simply shows "failed"' err.clear on error goto 0 'Still let script host handle all errors' exit sub end if .app.checked then clearlog "application" 'Clear each selected log' if .sys.checked then clearlog "system" if .sec.checked then clearlog "security" 'Note, There is a restriction under XP that security logs cannot be cleared ' wnd.alert("logs cleared") end with end sub clearlog(name) wql="select * from Win32_NTVentLogFile where logfilename='"&name&"" set logs=wmi.execquery(wql) 'Note that the members of logs are not for each log,' for each l in logs 'but for the file object specifying the log. ' if l.cleareventlog() then wnd.alert("Error clearing log"&name&"! ") ie.quit wscript.quit end if next end sub
The above is realized by outputting html content through vbs. In general, Xiaobian uses hta to realize image interface.
Thank you for reading! About "VBS script how to achieve GUI graphical interface and log clearance function" This article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.