อันนี้ทำมาฝาก ไว้ใช้สำหรับติดตั้งโปรแกรม ปรับปรุงโค๊ดมาค่อนข้างสมบูรณ์แล้ว
ประกอบด้วย VBmsgbox+JSprogressBar ..ถ้ามีอะไรดีดีอีก จะนำมาลงให้เพิ่มเติม....
dim bar1, i, Btn
set ObjShell = createobject("WScript.Shell")
Btn = MsgBox("ท่านต้องการติดตั้งโปรแกรมนี้ใช่หรือไม่?",36,"Confirm Message.")
If Btn = vbYes Then
ObjShell.Run"winamp512_full /S" 'ใส่โปรแกรมที่จะติดตั้งตรงนี้
Else
wscript.Quit()
End if
set bar1 = createobject("JSProgBr.Bar")
bar1.Title = " กำลังติดตั้ง โปรดรอสักครู่..."
bar1.Caption = "LOADING . . ."
bar1.Show True, True
For i = 0 to 29
bar1.Advance
wscript.sleep 500 'ลด-เพิ่ม ความเร็วของ progressbar ตรงนี้
If i = 0 Then bar1.Caption = "Installing.." & "10%"
If i = 3 Then bar1.Caption = "Installing.." & "20%"
If i = 6 Then bar1.Caption = "Installing.." & "30%"
If i = 9 Then bar1.Caption = "Installing.." & "40%"
If i = 12 Then bar1.Caption = "Installing.." & "50%"
If i = 15 Then bar1.Caption = "Installing.." & "60%"
If i = 18 Then bar1.Caption = "Installing.." & "70%"
If i = 21 Then bar1.Caption = "Installing.." & "80%"
If i = 25 Then bar1.Caption = "Installing.." & "90%"
If i = 28 Then bar1.Caption = "Installing.." & "100%"
If i = 29 Then bar1.Caption = "Successfull Complete."
If i = 29 Then bar1.Title = " ติดตั้งเรียบร้อย."
next
wscript.sleep 1000
bar1.hide
set bar1 = nothing
-----------------------------------------------------------
เป็นCode ที่แก้ไขปรับปรุงให้ดียิ่งขึ้นมาอีก
dim bar1, WshShell, i, Btn
set bar1 = createobject("JSProgBr.Bar")
set WshShell=CreateObject("WScript.Shell")
Btn=WshShell.Popup("ท่านต้องการติดตั้งโปรแกรมนี้ใช่หรือไม่?",10,"AutoPrograms Installer",36)
if Btn = 6 then
WshShell.Run"winamp512_full.exe /S"
bar1.Title = " กำลังติดตั้ง>โปรดรอ..."
bar1.Caption = "Installing [00%]"
bar1.Show True, True
For i = 0 to 29
bar1.Advance
wscript.sleep 500
if i = 1 then bar1.Caption = "Installing [10%]"
if i = 4 then bar1.Caption = "Installing [20%]"
if i = 7 then bar1.Caption = "Installing [30%]"
if i = 10 then bar1.Caption = "Installing [40%]"
if i = 13 then bar1.Caption = "Installing [50%]"
if i = 16 then bar1.Caption = "Installing [60%]"
if i = 19 then bar1.Caption = "Installing [70%]"
if i = 22 then bar1.Caption = "Installing [80%]"
if i = 25 then bar1.Caption = "Installing [90%]"
if i = 28 then bar1.Caption = "Installing [100%]"
if i = 29 then bar1.Caption = "Successful Complete"
if i = 29 then bar1.Title = " ติดตั้งเรียบร้อย"
next
wscript.sleep 2000
bar1.hide
set bar1 = nothing
else
WScript.Quit()
end if