script to collect PC info (SWs,Drivers,OS..)

Home Forums Scripting General Scripting script to collect PC info (SWs,Drivers,OS..)

This topic contains 3 replies, has 3 voices, and was last updated by Avatar vonPryz 10 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Avatar
    eyalr
    Member
    #145853

    Hello all,
    I need to build script that collect info about the PC.
    This should be work on XP,2003 & Vista.
    I work with file R.bat that I made.
    I’m looking for the DOS command for it. since it the basic level for all OS’s.

    About SW installed: I display the dirs in “c(or d):Program Files” by dir cmd, is there any better way that return also the version?

    About Users:How can I know the name of all users that installed on the PC?

    About drivers: Do you know a command for it?

    And other issue like: Motherboard, Display, Storage, Partitions, Inputs, Network, Peripherals, BIOS, Property, System Properties, Motherboard Properties and Chassis Properties.

    Is there any site with a commands regard it?

    Thanks all to your help,

    Avatar
    Silver23
    Member
    #292233

    Re: script to collect PC info (SWs,Drivers,OS..)

    I would try using WMI script.
    The commands are really not that hard, just time consuming to implement.

    Put it in a batch script and to do these things remotely you could use psexec.

    net view | find /i “\” >hosts.txt
    for /i %%i in (hosts.txt) do (
    psexec %%i hostname
    wmi command
    wmi command
    )

    something like the above would work, could take a few hours to create.

    Avatar
    vonPryz
    Member
    #347385

    Re: script to collect PC info (SWs,Drivers,OS..)

    Silver23;187802 wrote:
    for /i %%i in (hosts.txt) do (
    psexec %%i hostname
    wmi command
    wmi command
    )

    You know, instead of psexec, one can make remote WMI queries. Just pass the computer name along. In VBScript you can do like this:

    Code:
    GetObject(“winmgmts:\” & strComputer & “rootcimv2”)

    -vP

    Avatar
    Silver23
    Member
    #292234

    Re: script to collect PC info (SWs,Drivers,OS..)

    vonPryz has a good point.
    I really suck at WMI, so I’d have to look up everything on Technet.

    But you dont need VBscript to do that.
    I was kind of trying to keep it simple.

    Use wmic /? for a full commandline,

    If you like vbscript better use that.
    you can also user powershell

    example for a wmi command, this queries a logical disk:
    WMIC logicaldisk WHERE drivetype=3 GET name,freespace,SystemName,FileSystem,Size,VolumeSerialNumber

    add (/Node: “computername”) to do this on a different computer.

    so looking at my previous post; wmi command would be replaced by
    wmic /node:%%i

    Look here for some commands to get you started
    http://support.microsoft.com/servicedesks/webcasts/wc072402/listofsampleusage.asp

    technet also as a full database with explanations of WMI commands.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.