1. Hello Guest, selamat datang di Forum WinPoin. Kamu bisa bertanya, berdiskusi, sharing, dan ngobrolin apapun seputar Windows, Windows Phone, PC, Gadget, atau hal seputar Teknologi lainnya. Selamat berkomunitas! ;)

Solved VBScript Script File

Discussion in 'General' started by Abdi Wahyudi, Mar 22, 2017.

  1. Abdi Wahyudi

    Abdi Wahyudi Member

    Joined:
    Jul 8, 2015
    Messages:
    228
    Awal mulanya saya mencari program aplikasi buat ngasih peringatan kalau baterai laptop sudah hampir atau penuh. Setelah cari-cari, ketemu sesuatu yang lebih bagus, peringatan bisa dimunculkan tanpa program aplikasi tambahan, pakai VBScript. Scriptnya seperti ini.

    set oLocator = CreateObject("WbemScripting.SWbemLocator")
    set oServices = oLocator.ConnectServer(".","root\wmi")
    set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity")
    for each oResult in oResults
    iFull = oResult.FullChargedCapacity
    next
    while (1)
    set oResults = oServices.ExecQuery("select * from batterystatus")
    for each oResult in oResults
    iRemaining = oResult.RemainingCapacity
    bCharging = oResult.Charging
    next
    iPercent = ((iRemaining / iFull) * 100) mod 100
    if bCharging and (iPercent > 99) Then msgbox "Battery is at " & iPercent & "%",vbInformation, "Battery monitor"
    wscript.sleep 30000 ' 5 minutes
    wend

    Yang saya tebalkan merah itu awalnya 95. Berhasil! Peringatan muncul dan sangat mengganggu, jadi nggak kuatir bakal over charge (pikir saya). Karna 95-100% masih jauh, saya gantilah angkanya jadi 99 supaya peringatan muncul tepat saat baterai 100%. Taraa!!! Peringatan malah tidak muncul.

    Intinya, saya minta bantuan kepada seluruh member winpoin (terutama yang para senior) untuk ngasih tau atau setidaknya bantu edit scriptnya supaya peringatan muncul pas baterai sudah 100%. Begitu.

    Ahh, panjang amat!
    Itu saja dulu curhatnya.
    Mohon bantuannya ya.
    Terima kasih.
     
  2. Kawarama

    Kawarama Well-Known Member

    Joined:
    Dec 15, 2015
    Messages:
    1,361
    wanjiirr revot amat mak, ane pernah pake cara itu juga tapi ya gitu kgk sesuai harapan, make battery care aja gan, ntar dia manggil kok kalo udah sesuai angka* persenannya, BTW ane make conservation mode, utility dari lenovo, dia berfungsi membatasi pengisian, saat conservation mode aktif battery hanya akan terisi antara 50-60% saja, jadi kgk perlu watir overcharger, bahkan dianjurkan untuk org yg males banget bolak balik cabut - pasang charger, tapi mungkin ini hanya untuk lenovo user, kurang tau kalo yg lain :v

    Oko.png
     
    Last edited: Mar 22, 2017
  3. raxion

    raxion Well-Known Member

    Joined:
    Mar 16, 2016
    Messages:
    1,038
    Kok batterycare agan bagus amat? Battery care gw kek tampilah retro gitu :v
     
  4. Kawarama

    Kawarama Well-Known Member

    Joined:
    Dec 15, 2015
    Messages:
    1,361
    itu tampilan One key optimizer lenovo gan, mode conservation ada didalamnya, itu hasil tampilan click dari icon battery nya :'v
     
  5. raxion

    raxion Well-Known Member

    Joined:
    Mar 16, 2016
    Messages:
    1,038
    Eh asem lenovo rupanya :v
    Beginilah nasib user asus #curhat #eh
     
  6. Kawarama

    Kawarama Well-Known Member

    Joined:
    Dec 15, 2015
    Messages:
    1,361
    Wahaha kan udah ane bilang lenovo user, Asus kgk ada gan ?
     
  7. raxion

    raxion Well-Known Member

    Joined:
    Mar 16, 2016
    Messages:
    1,038
    Kaga ada gan. Ane pake yg 3rd party. Btw OOT nih :v
     
  8. Kawarama

    Kawarama Well-Known Member

    Joined:
    Dec 15, 2015
    Messages:
    1,361
    Aaah udah lah aggap aja rumah sendiri :v , yg 3rd party yg ente pake apa ? rule nya bagaimana ?
     
  9. raxion

    raxion Well-Known Member

    Joined:
    Mar 16, 2016
    Messages:
    1,038
    btcare.jpg
    Nih penampakannya
     
  10. Kawarama

    Kawarama Well-Known Member

    Joined:
    Dec 15, 2015
    Messages:
    1,361
    laah battrey care bisa menghentikan daya listrik yg masuk emngnya gan ? setau ane aplikasi itu cuma ngasih peringatan saat battrey berada di level tertentu* saja ?
     
  11. raxion

    raxion Well-Known Member

    Joined:
    Mar 16, 2016
    Messages:
    1,038
    Emang cuma ngasih peringatan :v
     
  12. Kawarama

    Kawarama Well-Known Member

    Joined:
    Dec 15, 2015
    Messages:
    1,361
    Ahhelaah gue kira iya :v
     
  13. Abdi Wahyudi

    Abdi Wahyudi Member

    Joined:
    Jul 8, 2015
    Messages:
    228
    Terima kasih sarannya mas.
    Sudah saya coba battery care. Tapi belum tau, bagaimana performanya.
     

Share This Page