Vbscript hard drive serial




















Register now while it's still free! Already a member? Close this window and log in. Join Us Close. Join Tek-Tips Forums! Join Us! By joining you are opting in to receive e-mail. Promoting, selling, recruiting, coursework and thesis posting is forbidden.

The batch file also uses psexec. We also use a text file that has the names of all of the machines on the network that we call a nodelist. So here is what the batch file looks like. The lines of equal signs is to make a recognizable line to look for the hostname and to divide the information in the file that it writes. The diskid32 executable writes the drive serials, product ids, version numbers, and even the MAC address of the computer.

So the file it writes back it pretty large, but the serials are easy to find. One of the other admins and I are working on a program to strip out the information that we need from the file and create a report that will be presentable. It works, gets the correct information, and is free.

I hope this can help someone. Tags: administration tools Scripting Windows. February 21, July 28, August 13, A lot of this depends on the operating system you are trying to get the hard drive serials from. We are still using XP, this makes some of the process different. We ended up using a script to push out a small executable to the workstation then use psexec to run the file. This file would return all of the computer info back to our server where we used vbs script to get only the information we needed and put it into a spreadsheet.

The file we used was diskid PageFileSize Wscript. TotalExcessFragments Wscript. TotalFiles Wscript. TotalFolders Wscript. TotalFragmentedFiles Wscript. TotalPageFileFragments Wscript. TotalPercentFragmentation Wscript. UsedSpace Wscript. VolumeName Wscript. Echo "This volume should be defragged. Echo "This volume does not need to be defragged.

Echo wmiDiskDrive. Script must be run on the local computer. GetDrive "C:" Wscript. When specifying the new drive letter, however, you only have to include the colon in the sample script, Q:.

If you modify this script to defragment a different volume such as X , note that your WQL query must specify the drive letter followed by a colon and then followed by two forward slashes. If you modify this script to dismount a different volume such as X , note that your WQL query must specify the drive letter followed by a colon and then followed by two backslashes.

The two parameters: 1 force the volume to be dismounted, even if users are currently connected to it; and, 2 place the volume in a no-automount, offline state. This script can be modified by setting either or both of these parameters to False. DriveLetter Wscript. FreeSpace Else Wscript. DeviceID Wscript. Availability For Each strCapability in objItem. Capabilities Wscript. Caption Wscript. Description Wscript. Drive Wscript. Manufacturer Wscript.

MediaLoaded Wscript. MediaType Wscript. Name Wscript. AvailableSpace Wscript. DriveType Wscript. FileSystem Wscript. IsReady Wscript. Path Wscript. RootFolder Wscript. SerialNumber Wscript. ShareName Wscript. TotalSize Wscript. BlockSize Wscript. Bootable Wscript. BootPartition Wscript. DiskIndex Wscript. Index Wscript. NumberOfBlocks Wscript. PrimaryPartition Wscript. Size Wscript.



0コメント

  • 1000 / 1000