R
Rodney
Ok, here's my scenerio.
I have a FORM which has a LIST BOX of computers.
I have a SUBFORM with in the FORM that is linked via the
computers name.
When I click the Computer's Name in the list box, the
subform is updated. This is done, now problem.
Now I have some code, various one's that I want to insert
into a Command Button that will do a certain task. For
example: (This will grab the service pack version of the
computer named in strComputer = "")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile
("c:\scripts\test.txt", True)
strComputer = "Computer Name"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
objTextFile.WriteLine "ServicePackVersion"
For Each objOperatingSystems in colOperatingSystems
objTextFile.WriteLine
objOperatingSystems.ServicePackMajorVersion _
& "." &
objOperatingSystems.ServicePackMinorVersion
Next
ObjTextFile.Close
I want to be able to have some code GRAB the ComputerName
from the subform, and run this code against it. How can
this be accomplished?
Thanks
I have a FORM which has a LIST BOX of computers.
I have a SUBFORM with in the FORM that is linked via the
computers name.
When I click the Computer's Name in the list box, the
subform is updated. This is done, now problem.
Now I have some code, various one's that I want to insert
into a Command Button that will do a certain task. For
example: (This will grab the service pack version of the
computer named in strComputer = "")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile
("c:\scripts\test.txt", True)
strComputer = "Computer Name"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
objTextFile.WriteLine "ServicePackVersion"
For Each objOperatingSystems in colOperatingSystems
objTextFile.WriteLine
objOperatingSystems.ServicePackMajorVersion _
& "." &
objOperatingSystems.ServicePackMinorVersion
Next
ObjTextFile.Close
I want to be able to have some code GRAB the ComputerName
from the subform, and run this code against it. How can
this be accomplished?
Thanks