Jump to content

Program Care Anunta Cand Bateria E Incarcata?


robotboy

Recommended Posts

Salutare, astazi o ruda (mai in varsta) m-a intrebat daca cunosc vreun program care sa il instiinteze cand bateria laptopului (are un HP) a fost incarcata. Mai exact, doreste sa ii fie afisata o fereastra pe ecran care sa ii spuna ca bateria a fost incarcata complet, pentru a scoate laptopul din priza. Laptopul dispune de un beculet care indica cand bateria se incarca sau cand aceasta este descarcata insa el ar dori un program care sa faca ceea ce am scria mai sus. Pentru ca eu nu am stiut un asemenea program m-am gandit sa intreb si pe aici.

Cunoasteti/exista un asemenea program?

Multumesc!

Va invit sa vizitati categoria: Cheat Codes a forumului, precum si: Cerinte de Sistem.

Link to comment
Share on other sites

Are Windows 7. Imi poti spune despre ce widget-uri e vorba?

Din ce am inteles il intereseaza o instiintare de tip fereastra pop-up, asemeni celei care ii spune ca bateria e descarcata si ca necesita conectarea incarcatorului, insa orice sfat este bun.

Va invit sa vizitati categoria: Cheat Codes a forumului, precum si: Cerinte de Sistem.

Link to comment
Share on other sites

Codul e luat de pe http://blogs.technet.com/b/jhoward/archive/2013/04/24/get-an-alert-when-my-battery-reaches-95.aspx si doar ajustat. 
(sper sa mearga ok.. sincer nush cum face programu ce face exact, prima oara cand vad asta:)) )

 set oLocator = CreateObject("WbemScripting.SWbemLocator")
 
set oServices = oLocator.ConnectServer(".","rootwmi")
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
   Wscript.echo "Baterie plina"
  end if
  wscript.sleep 40000
  
wend 

ups, acu ca ma uit..am sters, si am scris inapoi cam aceasi chestie doar ca mai urat :)) mda, tare. poti sa iei si codu direct din linku de mai sus. face aceasi chestie.
app, in ultimele randuri... iPercent>99 zice cat sa fie bateria.
wscript.sleep 40000 zice cat sa astepte ( ~6 minute asa) intre verificari.

love is a verb
Love is a doing word

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.