检查计算机是否以批处理文件的形式连接到交流电源 [英] Check if computer is plugged into AC power in batch file

查看:54
本文介绍了检查计算机是否以批处理文件的形式连接到交流电源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何像Windows中的on_ac_power一样在Windows 7中的批处理文件中检查计算机是否已插入交流电源?

How can I check if computer is plugged into AC power in a batch file in windows 7, like on_ac_power does in linux?

推荐答案

有直接的批处理文件方式:

There's a direct batch file way:

WMIC Path Win32_Battery Get BatteryStatus

使用此魔法和一些find/errorlevel魔法,您应该能够将其变成条件.

Using this and some find/errorlevel magic, you should be able to turn it into a condition.

这篇关于检查计算机是否以批处理文件的形式连接到交流电源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆