langkah pertama, buka program editor Notepad lalu copy paste-kan listing program dibawah ke editor Notepad anda dan kemudian simpan ke dalam file yang diberi nama misalnya ‘PC Info.vbs’. Listing programnya seperti dibawah ini :

‘ PC Info

On Error Resume Next
strComputer = “.”
Set objWMIService = GetObject(”winmgmts:” _
& “{impersonationLevel=impersonate}!” & strComputer & “rootcimv2″)

Set colItems = objWMIService.ExecQuery(”Select * from Win32_PhysicalMemory”)
Set colItems_cpu = objWMIService.ExecQuery(”Select * from Win32_Processor”)

msg = “Specification of your PC” & vbCrLf
ram = 0
For Each objItem in colItems
capacity = objItem.Capacity
ram = ram + capacity
Next
ram = ram / (1024 * 1024)

For Each objItem in colItems_cpu
cpu_name = Trim(objItem.Name)
Next

msg = msg & vbCrLf & “- CPU Name : ” & cpu_name
msg = msg & vbCrLf & vbCrLf & “- Capacity of RAM : ” & ram & ” MB”
msg = msg & vbCrLf & vbCrLf & “- Capacity of HDD :”

Set objFSO = CreateObject(”Scripting.FileSystemObject”)
Set colDrives = objFSO.Drives

For Each objDrive in colDrives
If objDrive.DriveType = 2 Then
msg = msg & vbCrLf & “* Drive letter : ” & objDrive.DriveLetter
msg = msg & vbCrLf & “*** Total size : ” & FormatNumber(objDrive.TotalSize / (1024 * 1024 * 1024),2) & ” GB”
msg = msg & vbCrLf & “*** Free space : ” & FormatNumber(objDrive.FreeSpace / (1024 * 1024 * 1024),2) & ” GB”
End If
Next

strComputer = “.”
Set objWMIService = GetObject(”winmgmts:” _
& “{impersonationLevel=impersonate}!” & strComputer & “rootcimv2″)

Set IPConfigSet = objWMIService.ExecQuery _
(”Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE”)

For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
msg = msg & vbCrLf & vbCrLf & “- IP Address : ” & IPConfig.IPAddress(i)
Next
End If
Next

Set oShell=CreateObject(”wscript.shell”)
Set oEnvironment=oShell.Environment(”Process”)
sComputerName=oEnvironment(”COMPUTERNAME”)

msg = msg & vbCrLf& vbCrLf & “- Computer Name : ” & sComputerName

Msgbox msg, vbInformation, “Info for your Personal Computer”

Cara menjalankan programnya sederhana, anda cukup klik dua kali file yang sudah disimpan tadi (PC Info.vbs) dari Windows Explorer. Untuk informasi, program yang sudah kita buat bisa dijadikan file exe (executable) dengan aplikasi yang bernama ‘ScriptCryptor’.

Sebagai penutup diberikan alamat download beberapa program yang saya harap dapat bermanfaat untuk digunakan dalam membuat program VBS (Visual Basic Script) :

1. Program ‘PC Info’ dalam format executable (PC Info.exe)
http://www.ziddu.com/download/9575583/PCInfo.exe.html

2. Program ‘ScriptCryptor’ untuk merubah format file vbs menjadi format exe (executable)
http://www.ziddu.com/download/9575654/ScriptCryptor.zip.html

3. Program VBSEdit untuk membuat, mengedit dan menjalankan program VBS
http://www.ziddu.com/download/9397118/vbsedit.exe.html

Selamat mencoba ……..
Diposting oleh adritkj

0 komentar:

Visit the Site
MARVEL and SPIDER-MAN: TM & 2007 Marvel Characters, Inc. Motion Picture © 2007 Columbia Pictures Industries, Inc. All Rights Reserved. 2007 Sony Pictures Digital Inc. All rights reserved. blogger templates