Get the App
SLTechnology News&Howtos  ›  Development  › 

How to write a script sysinfo.vbs that can get the current system information

Shulou Source: shulou.com Published: 2022-06-03 08:35:57 10月30日 Update

This article introduces the knowledge of "how to write a script sysinfo.vbs that can get the current system information". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The copy code is as follows:

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

With wscript.arguments

If .count > 0 then

Ipaddress= "."

Outfile= ""

Username= ""

Password= ""

Viewtype=0

Program=0

For arg=0 to .count-1

Select case left (lcase (.item (arg)), 2)

Case "/ h", "/?", "\ h", "\?"

Usage ()

Wscript.quit

Case "/ r", "\ r"

If arg+31 then

For iTunes 0 to jmur1

For karma 0 to j-i-1

If strcomp (str (k), str (kryp1), 1) = 1 then

Strtemp=str (kryp1)

Str (kryp1) = str (k)

Str (k) = strtemp

End if

Next

Next

End if

For iTunes 0 to jmur1

Wnl "& str (I)

Next

End if

Sub showerr ()

If err.number then

Wscript.echo "Error 0x" & cstr (hex (err.number)) & ".

If err.description "" then

Wscript.echo "Error description:" & err.description&. "

End if

Wscript.quit

End if

End sub

Sub wnl (msg)

Wscript.echo msg

If isobject (of) then

On error resume next

Of.writeline msg

Showerror ()

On error goto 0

End if

End sub

Function wfl (byref obj)

Str= ""

For iTun0 to ubound (obj)

Str=str&obj (I) & ""

Next

Wfl=str

End function

Function wsp (msg,num)

If msg "" then

Msg=left (msg,num-1)

Wsp=msg&space (num-len (msg))

Else

Wsp=space (num)

End if

End function

Function timeformat (msg)

Timeformat=left (msg,4) & "/" & mid (msg,5,2) & "/" & mid (msg,7,2) & "& mid (msg,9,2) &": & mid (msg,11,2) & ": & mid (msg,13,2)

End function

Function sizeformat (msg)

If msg "" then

Size=msg/1048576

If size > 1024 then

Sizeformat=round (size/1024,2) & "GB"

Else

Sizeformat=round (size,1) & "MB"

End if

End if

End function

Function objget (msg)

Set col=objswb.instancesof (msg)

For each objx in col

Set obj=objx

Next

Set objget=obj

End function

Function usage ()

Wscript.echo string (79, "*")

Wscript.echo "RGIS v1.03"

Wscript.echo "Remote Get Infomation Script, by zzzEVAzzz"

Wscript.echo "Welcome to visite www.isgrey.com & www.h5h5.com"

Wscript.echo "Usage:"

Wscript.echo "cscript rgis.vbs [/ r targetIP username password] [/ o filename] [/ v] [/ a] [/ h]"

Wscript.echo "/ r: remote get info."

Wscript.echo "/ o: output to file."

Wscript.echo "/ v: get more infomation."

Wscript.echo "/ a: get applications infomation."

Wscript.echo "/ h: show usage."

Wscript.echo string (79, "*") & vbcrlf

End function

This is the end of "how to write a script sysinfo.vbs that can get current system information". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Information systems scripts code content more knowledge practicality learning next dilemma reality situation articles cases editing websites industries processes high quality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker NVidia Apple Huawei Shulou Information