티스토리 뷰
바탕화면 우클릭-새로 만들기-바로 가기-항목 위치 입력
D:\Utility\monitor\monitor.bat
바로가기 우클릭-속성-아이콘 변경-빨간 전원버튼 선택
monitor.ps1
# Declare SendMessage Parameter Values
$HWND = -1
$WM_SYSCOMMAND = 0x0112
$SC_MONITORPOWER = 0xF170
$MONITOR_ON = -1
$MONITOR_OFF = 2
#Store the C# signature of the SendMessage function.
$signature = @"
[DllImport("user32.dll")]
public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);
"@
#Add the SendMessage function as a static method of a class
$SendMessage = Add-Type -MemberDefinition $signature -Name "Win32SendMessage"-Namespace Win32Functions -PassThru
#Invoke the SendMessage Function
$SendMessage::SendMessage($HWND, $WM_SYSCOMMAND, $SC_MONITORPOWER,$MONITOR_OFF)
monitor.bat
Powershell.exe -executionpolicy bypass D:\Utility\monitor\monitor.ps1
출처 - https://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/how-can-i-turn-off-the-monitor-ie-put-it-to-sleep/0ea689fd-bc46-4329-8f2c-bf9967d18114?auth=1
'Study' 카테고리의 다른 글
Java(자바) JSP 설정 관련 (1) | 2023.01.08 |
---|---|
Java(자바) JSP Tomcat(톰캣) 관련 (0) | 2023.01.08 |
gulp(걸프) Error(에러) 관련 (0) | 2023.01.07 |
gulp(걸프) 관련 (0) | 2023.01.07 |
RDash Angular(앵귤러) 관련 (0) | 2023.01.07 |