Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert from vbscript to VB6

Status
Not open for further replies.

ASPVBNerd

Programmer
Nov 23, 2005
83
SE
If I would like to to this with VB6 is it possible?

VBSCRIPT
Code:
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems

    	strOS = objOperatingSystem.Caption
    	Wscript.Echo strOS 
	
Next
 
Yes

The only bit that you'd really have to change is the output method: wscript.echo doesn't exist in VB. There are plenty of other choices, however, eg: Print, Debug.Print, MsgBox, adding the items into a listbox or a listview (or even a treeview)
 
Okay, is it possible through VB to get the ip-address of a remote computer?

George
 
Never mind my last question. I asked the same question in Vbscript forum and PHV solved ut to me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top