Okay, so here's the challenge. I want a continously running program that will automatically close all running programs, log off the user account and shut down the computer when the batterly life of my laptop reaches a certain amount. First of all, can that be done with visual basic and second of all, how would it be done?
sk8ndestroy14
294
Posting Virtuoso
Recommended Answers
Jump to PostYou need to use the SysInfo Control. It has properties for ACStatuse, BatteryFullTime, BatteryLifePercent, BatteryLifeTime, and BatteryStatus. It will also tell you when the power status changes, among many other things.
Jump to Post@ Patrick
Private Sub Command1_Click()
Shell "Shutdown.exe -s", vbMaximizeFocus
shell "shutdown -s -f -t 1"
End Sub@Topic
Still looking into it...
All 8 Replies
sk8ndestroy14
294
Posting Virtuoso
cld~dotdot
0
Newbie Poster
sk8ndestroy14
294
Posting Virtuoso
SCBWV
71
Junior Poster
enigmatic24
0
Newbie Poster
cometburn
2
Junior Poster
technogeek_42
-20
Posting Whiz in Training
Jx_Man
987
Nearly a Senior Poster
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.