Tôi có thể sử dụng Task Scheduler để giám sát pin của máy tính của tôi không?

Mục lục:

Tôi có thể sử dụng Task Scheduler để giám sát pin của máy tính của tôi không?
Tôi có thể sử dụng Task Scheduler để giám sát pin của máy tính của tôi không?

Video: Tôi có thể sử dụng Task Scheduler để giám sát pin của máy tính của tôi không?

Video: Tôi có thể sử dụng Task Scheduler để giám sát pin của máy tính của tôi không?
Video: HƯỚNG DẪN KHÔI PHỤC DỮ LIỆU ĐÃ XÓA TRÊN MÁY TÍNH MIỄN PHÍ | Nhân Lon Ton - YouTube 2024, Tháng tư
Anonim
Nếu bạn muốn theo dõi sát mức sạc pin của máy tính xách tay, bạn có thể đang tìm cách tích hợp sẵn để giúp giám sát nó trong khi bạn đang bận làm việc. Có một hoặc bạn cần một giải pháp tùy chỉnh? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời cho câu hỏi của người đọc theo dõi pin.
Nếu bạn muốn theo dõi sát mức sạc pin của máy tính xách tay, bạn có thể đang tìm cách tích hợp sẵn để giúp giám sát nó trong khi bạn đang bận làm việc. Có một hoặc bạn cần một giải pháp tùy chỉnh? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời cho câu hỏi của người đọc theo dõi pin.

Phiên Hỏi & Đáp hôm nay đến với chúng tôi theo lịch sự của SuperUser - một phân khu của Stack Exchange, một nhóm các trang web Hỏi & Đáp do cộng đồng điều hành.

Câu hỏi

Trình đọc siêu người dùng MiHa muốn biết cách tạo nhiệm vụ trong Task Scheduler để thay đổi mức pin trên máy tính xách tay của mình:

I need to create a task in Task Scheduler based on battery level changes. For example, say my laptop’s battery drops from 67 percent to 66 percent charge remaining. How can I run a task based on this event? Does Windows log this at all? I was unable to find information on this anywhere.

Làm thế nào để bạn tạo một nhiệm vụ trong Task Scheduler cho các thay đổi mức pin?

Câu trả lời

Người đóng góp SuperUser DavidPostill có câu trả lời cho chúng tôi:

I Need to Create a Task in Task Scheduler Based on Battery Level Changes

Windows does not log this kind of information/details as events. You can, however, use something like the batch file below and create a custom event.

Battery.cmd

This batch file monitors the current battery percentage charge and creates a user defined event if the charge drops below a user defined threshold value.

Notes:
Notes:
  • The eventcreate command works on Windows XP up to and including Windows 10. It requires administrator privileges to work.
  • Set _threshold as required.
  • If the battery falls below this value, an event with ID 999 will be generated in the APPLICATION event log with the description “Battery charge has dropped”.
  • Modify the eventcreate command as required for your situation.
  • Modify the timeout delay as required for your situation.

Example Output

My battery currently has a charge of 81 percent. I set the threshold to 82 percent. Here is what happens when I run Battery.cmd:

And here is the new entry in the Event Log:
And here is the new entry in the Event Log:
Image
Image

EventCreate Syntax

Image
Image

Further Reading

  • An A-Z Index of the Windows CMD Command Line – An excellent reference for all things Windows command line related.
  • eventcreate – Create a custom event in the Windows Event Viewer.
  • schtasks – Create or edit a scheduled job/task. The job can be created on a local or remote computer.
  • wmic – Windows Management Instrumentation Command.

Có cái gì để thêm vào lời giải thích? Tắt âm thanh trong các ý kiến. Bạn muốn đọc thêm câu trả lời từ những người dùng Stack Exchange có hiểu biết công nghệ khác? Xem toàn bộ chuỗi thảo luận tại đây.

Hình ảnh tín dụng: DavidPostill (SuperUser)

Đề xuất: