WinPower

버전 1.2.0.0 (14.9 KB) 작성자: Jan
Shutdown, sleep, hibernate etc. of Windows computers
다운로드 수: 862
업데이트 날짜: 2023/11/9

라이선스 보기

WinPower - Mex function to set the power status on Windows computers
Power off, shut down, logoff, sleep, reboot, reboot and restart Matlab, disable/enable sleeping, lock
WinPower(Command, Force)
INPUT:
Command: String, not case-sensitive.
'poweroff': Switch power off.
'reboot': Reboot the machine.
'logoff': Logoff the current user.
'shutdown': Shut down the machine to a state, which allows the user to
switch off the power securely by hand.
'sleep': Let the machine fall asleep.
'sleep', 'off': Disable the sleep timers, 'on' enables them.
'hibernate': Write memory to disk and fall into deep sleep.
'lock': Lock the machine, password is required for wake-up.
'rebootmatlab': Reboot the machine, restart Matlab when the user is
logged in again.
'monitor': Set monitor status without stopping the processing.
2nd input: 'off' (default), 'on', 'standby'.
Moving the mouse etc. enables the monitor automatically.
'battery': Reply the battery related parameters for laptops.
Force: Optional argument to force the action:
'force': Close waiting applications. Dangerous.
'forceifhung': Close waiting and crashed applications. Dangerous.
EXAMPLES:
1. Try a poweroff, do not kill waiting applications:
WinPower('poweroff');
2. Force a poweroff (unsaved documents are lost!):
WinPower('poweroff', 'forceifhung');
3. Do not let the computer fall asleep during a long computation:
WinPower('Sleep', 'off'); Long_Calculation(); WinPower('Sleep', 'on');
4. Reboot the machine and after the user is logged in Matlab is started with
the bench() function:
WinPower('RebootMatlab', 'bench(2)');
5. Get the battery parameters:
Status = WinPower('BatteryStatus')
6. Switch off the monitor for 5 seconds:
WinPower('Monitor', 'off'); pause(5); WinPower('Monitor', 'on');
WinPower runs under Windows only. It can be compiled with MSVC2008/2010, but LCC shipped with Matlab 32bit fails. In case of troubles or for Matlab 6.5 download pre-compiled files:
http://www.n-simon.de/mex
Tested: Matlab 6.5, 7.7, 7.8, 7.13, WinXP/32, Win7/64
Compiler: OWC1.8, MSVC2008/2010
Assumed Compatibility: higher Matlab versions, Vista, Windows8.

인용 양식

Jan (2024). WinPower (https://www.mathworks.com/matlabcentral/fileexchange/37647-winpower), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Startup and Shutdown에 대해 자세히 알아보기
커뮤니티
 Power Electronics Control 커뮤니티에 더 많은 파일이 있습니다

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

"RebootMatlab" is working now.

1.1.0.0

Try to get 'monitor' command working under Win10. Thanks to Richard Walker.
BatteryStatus, Monitor off.

1.0.0.0