Click here to Skip to main content
15,891,136 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 13:50
MAP Tiger25-Jul-08 13:50 
GeneralRe: How to search specific record faster Pin
Mycroft Holmes25-Jul-08 15:41
professionalMycroft Holmes25-Jul-08 15:41 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 16:19
MAP Tiger25-Jul-08 16:19 
GeneralRe: How to search specific record faster Pin
Mycroft Holmes25-Jul-08 16:33
professionalMycroft Holmes25-Jul-08 16:33 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 16:45
MAP Tiger25-Jul-08 16:45 
QuestionThreading question Pin
Cory Kimble24-Jul-08 9:23
Cory Kimble24-Jul-08 9:23 
AnswerRe: Threading question Pin
Luc Pattyn24-Jul-08 16:51
sitebuilderLuc Pattyn24-Jul-08 16:51 
QuestionRunning Windows Script on local network Computer Pin
Nerber24-Jul-08 9:01
Nerber24-Jul-08 9:01 
Hi!
I hope this is the right forum for this. I'm sorry if it isn't, please recommend a different one.

I have a .wsf written in VBScript. It gathers information about the computer it is run on and prints that out to a text document. It currently works from my computer and gathers information about my computer. However, I need to be able to run this script from any machine on the local network and retrieve the information about a server computer, which is probably just a tower in some room somewhere in another state.
SSH is out because as far as I know, SSH doesn't come preinstalled on windows and I can't assume that the computers have them; the program needs to be completely independent so I can just install it on any computer and go.
I'm running the script from a .bat file, but I think I have to change the script, not the bat file, since all the bat file does is port it to a text file.

So basically the wsf is the gist of (I just inherited this; i think it's right though because it works on my own computer):
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set CompInfo = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")

For Each objComputer In CompInfo
	PCName = objComputer.Name
	PCDomain = objComputer.Domain
	UserName = objComputer.UserName
Next

Wscript.Echo "ComputerName: " & PCName  
Wscript.Echo "Domain: " & PCDomain 
Wscript.Echo "UserName: " & UserName

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colCSes = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
For Each objCS In colCSes
  WScript.Echo "Computer Name: " & objCS.Name
  WScript.Echo "System Type: " & objCS.SystemType
  WScript.Echo "Number Of Processors: " & objCS.NumberOfProcessors
Next
Set colProcessors = objWMIService.ExecQuery("Select * from Win32_Processor")
For Each objProcessor in colProcessors
  WScript.Echo "Manufacturer: " & objProcessor.Manufacturer
  WScript.Echo "Name: " & objProcessor.Name
  WScript.Echo "Description: " & objProcessor.Description
  WScript.Echo "Processor ID: " & objProcessor.ProcessorID
  'WScript.Echo "Address Width: " & objProcessor.AddressWidth
  'WScript.Echo "Data Width: " & objProcessor.DataWidth
  WScript.Echo "Family: " & objProcessor.Family
  WScript.Echo "Maximum Clock Speed: " & objProcessor.MaxClockSpeed
Next



I'm sure that the first line, "strComputer = "."", needs to change from a . to the name of the computer, but how do I provide authentication? Can I just change the name to the name of the server, like hscs-gsgs or whatever, or do I need the network - networkname\hscs-gsgs? Sorry, I'm really lost.

Any help you could give would be great. Thanks in advance!
AnswerRe: Running Windows Script on local network Computer Pin
Uros Calakovic25-Jul-08 4:52
Uros Calakovic25-Jul-08 4:52 
QuestionButton inside of a group box Pin
sa_runner24-Jul-08 7:56
sa_runner24-Jul-08 7:56 
AnswerRe: Button inside of a group box Pin
sa_runner24-Jul-08 8:09
sa_runner24-Jul-08 8:09 
QuestionOdd question of the day: In a custom control, how do you get the + sign for nested properties? Pin
Jon_Boy24-Jul-08 4:16
Jon_Boy24-Jul-08 4:16 
AnswerRe: Odd question of the day: In a custom control, how do you get the + sign for nested properties? Pin
Tom Deketelaere24-Jul-08 5:23
professionalTom Deketelaere24-Jul-08 5:23 
AnswerRe: Odd question of the day: In a custom control, how do you get the + sign for nested properties? Pin
Thomas Stockwell24-Jul-08 5:31
professionalThomas Stockwell24-Jul-08 5:31 
GeneralRe: Odd question of the day: In a custom control, how do you get the + sign for nested properties? Pin
Jon_Boy24-Jul-08 5:54
Jon_Boy24-Jul-08 5:54 
Question[Message Deleted] Pin
vidhish24-Jul-08 1:09
vidhish24-Jul-08 1:09 
AnswerRe: concatanation Pin
John Ad24-Jul-08 1:13
John Ad24-Jul-08 1:13 
QuestionAccess Permission Pin
monika_vasvani24-Jul-08 0:05
monika_vasvani24-Jul-08 0:05 
AnswerRe: Access Permission Pin
~Khatri Mitesh~24-Jul-08 1:08
~Khatri Mitesh~24-Jul-08 1:08 
AnswerRe: Access Permission Pin
jzonthemtn24-Jul-08 3:41
jzonthemtn24-Jul-08 3:41 
QuestionPrinting with ZedGraph ! Pin
CrocodileBuck23-Jul-08 21:44
CrocodileBuck23-Jul-08 21:44 
AnswerRe: Printing with ZedGraph ! Pin
Steven J Jowett24-Jul-08 22:39
Steven J Jowett24-Jul-08 22:39 
Questionis there any function in vb where you can retrieve if a specific removable drive or disk is write protected = true or false?? [modified] Pin
vbDigger'z23-Jul-08 21:16
vbDigger'z23-Jul-08 21:16 
AnswerRe: is there any function in vb where you can retrieve if a specific removable drive or disk is write protected = true or false?? Pin
jzonthemtn24-Jul-08 3:43
jzonthemtn24-Jul-08 3:43 
GeneralRe: is there any function in vb where you can retrieve if a specific removable drive or disk is write protected = true or false?? Pin
vbDigger'z24-Jul-08 17:14
vbDigger'z24-Jul-08 17:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.