Berikut... merupakan beberapa contoh VBScript hasil ajaran paman Google
http://www.ilmukomputer.com
http://ns7.webmasters.com/caspdoc/html/vbscript_language_reference.htm
dan lainnya...
yang sering digunakan!!
apalagi untuk menangani virus secara manual...
ATTRIB FILE
===========
Set red = CreateObject("Scripting.FileSystemObject")
: Set one = red.getfile("C:\file1ku.exe")
: one.Attributes = 32
: Set one = red.getfile("C:\file2ku.exe")
: one.Attributes = 39
# atribut yg akan dipakai tergantung pada kode yang ditulis di line 3 script diatas
kode atribut yg bisa dipakai:
- 32 ; tanpa memakai atribut.
- 33 ; read-only
- 34 ; hidden
- 35 ; read-only + hidden
- 36 ; tidak bisa di hidden
- 37 ; read-only + tidak bisa dihidden
- 38 ; hidden (terproteksi)
- 39 ; hidden (terproteksi) + read-only
KREASI FILE TEKS
================
oni = "aa"
two = "bb"
Set one = CreateObject("Scripting.FileSystemObject")
: pbs = "[General]"&vbcrlf&"Manufacturer=" & oni & vbcrlf & "Model=" & two
: Set wan = one.createtextfile("C:\oeminfo.ini", 2, True)
: wan.write pbs
: wan.Close
MENGHAPUS FILE
==============
Set one = CreateObject("Scripting.FileSystemObject")
: one.deletefile("C:\WINDOWS\system32\mui\virus by iwan.vbs")
MENULIS REGISTRY
================
Set rg = CreateObject("WScript.Shell")
: rg.regwrite "HKCU\Software\Microsoft\Internet Explorer\Toolbar\BackBitmapShell", "D:\My Pictures\XP Styler\style terkini\iwan_plwl2.bmp", "RDW"
MENGHAPUS REGISTRY
==================
Set pbs = Wscript.CreateObject("WScript.Shell")
: pbs.regdelete "HKCU\Software\Microsoft\Internet Explorer\Main\Window Title"
SOROT FILE PADA SETIAP DRIVE
============================
Set one = CreateObject("Scripting.FileSystemObject")
For Each FlashDisk In one.drives
If (FlashDisk.drivetype = 1 Or FlashDisk.drivetype = 2) And FlashDisk.Path <> "A:" Then
: Set rid = one.getfile(FlashDisk.Path & "\autorun.inf")
: rid.Attributes = 32
: one.deletefile(FlashDisk.Path & "\autorun.inf")
: End If
Next
KREASI MAIN WINDOW
==================
dim one, ket, kat, two, rid, pbs, wan
masuk()
sub masuk()
Set one = CreateObject("Scripting.FileSystemObject")
ket = "Ketik TITLE yang ingin ditampilkan pada Property My Computer. Kemudian tekan Enter." & vbcrlf & vbcrlf &_
"Sebagai Contoh :" & vbcrlf &_
"Silahkan Ketik Nama Kamu!!!"
kat = "Ketik INFORMASI yang ingin ditampilkan pada Property My Computer. Kemudian tekan Enter." & vbcrlf & vbcrlf &_
"Sebagai Contoh :" & vbcrlf &_
"Microsoft Windows XP"
two = inputbox(ket,"Title",title)
rid = inputbox(kat,"Informasi",keterangan)
pbs = "[General]"&vbcrlf&"Manufacturer=" & two & vbcrlf & "Model=" & rid
Set wan = one.createtextfile("C:\WINDOWS\system32\oeminfo.ini", 2, True)
wan.write pbs
wan.Close
msgbox "Informasi pada Property My Computer telah diubah silahkan dicek. Terima kasih!!!"
end sub







