OS/WINDOWS

UAC PROMPT없는 관리자 실행파일 윈도우 백그라운드 자동실행(GUI, CMD)

KayEsQuo 2021. 7. 27. 12:06

UAC 알림창

관리자 실행파일을 시작프로그램에 등록하여 백그라운드 방식(실행창 없음)으로 구동하는 법을 설명하고자 한다.

 윈도우에서의 관리자 실행파일은 백그라운드 형식으로 진행 시 여러모로 제약이 많다. 특히, 권한 문제로 인한 관리자 실행파일을 실행 시 매번 UAC 프롬프트를 마주하거나, 시작프로그램에 애플리케이션을 등록하여도 동작하지 않는 경우가 다반사다.

 이와 같은 문제(UAC, 백그라운드)들을 해결하기 위해서 작업스케줄러를 활용하여 실행파일을 생성하는 방법이 있고, GUI모드와 CMD모드로 나누어 설명하고자 한다.

 

 

 

간략히..

관리자 실행파일을 시스템 시작 시 백그라운드로 실행하기 위해서는 크게 2가지 작업이 필요하고 각 프로세스는 모드(GUI, CMD)별로 설명한다.

 

GUI모드

    A. 작업스케줄러에서 관리자용 작업 생성. 

    B. 바로가기 아이콘과 작업을 서로 연결.

CMD모드

    A. 작업스케줄러 생성 및 실행시간 설정

 

 

 

GUI모드

A. 작업스케줄러 관리자용 작업 생성

윈도우 찾기 기능을 이용해 "작업 스케줄러" 검색

 

 

왼쪽 하단의 작업 스케줄러 라이브러리 클릭 후 오른쪽 작업창의 작업 만들기 클릭

 

 

작업 이름 입력

 

 

창이 없이 백그라운드 실행을 위한 라디오 버튼 체크

 

 

UAC 프롬프트 알림 창을 제외하기 위한 라디오 버튼 체크

 

 

동작할 애플리케이션 새로 만들기

 

 

실행할 프로그램 파일 절대 경로 입력하기 ex) C:\example.exe

 

 

 

 

B. 바로 가기 만들기

바로가기 클릭

 

 

바로 가기 항목 위치 입력 ex) "schtasks /run /tn 작업 이름 입력"

 

 

바로 가기 아이콘 이름 설정

 

 

실행 결과

 

 

 

 

CMD 모드

A. 작업스케줄러 생성 및 실행시간 설정 (CMD)

    GUI모드로는 2가지( 작업생성, 시작프로그램 등록 ) 작업을 해야했지만, CMD(관리자용)를 활용하면 아래의 코드와 같이 한줄이면 충분하다. 

 

SCHTASKS /Create /TN "New Task" /SC ONLOGON /TR blah.exe /RU username /RP password /RL HIGHEST

/TN : 작업 이름

/SC : 매시간 설정

/TR : exe파일 절대 경로

/RU : 사용자 계정

/RP : 사용자 계정의 비밀번호

/RL : 관리자 계정 권한 부여

 

 

 

 

이상으로 특정 프로그램에 UAC프롬프트 알림이 없는 관리자용 프로그램 생성에 대해 알아보았다.

 

 

참고

Windows 10에서 UAC 프롬프트없이 관리자 모드 바로 가기 만들기 - 최신 (choesin.com)

 

Windows 10에서 UAC 프롬프트없이 관리자 모드 바로 가기 만들기 - 최신

Windows 10의 UAC (사용자 액세스 제어) 프롬프트는 특히 관리자 권한이 필요한 프로그램을 자주 실행할 때 성 가실 수 있습니다. 다행히 UAC를 요구하지 않는 바로 가기를 만드는 방법이 있습니다.

choesin.com

How do I set a Windows scheduled task to run in the background? - Stack Overflow

 

How do I set a Windows scheduled task to run in the background?

Does anyone know how to set a scheduled task to run in background using Windows Task Scheduler? There doesn't seem to be any option to do this.

stackoverflow.com

How to create scheduled tasks with Command Prompt on Windows 10 | Windows Central

 

Command Prompt allows you to create scheduled tasks faster — here's how

In this guide we'll show you the steps to get started creating, editing, and deleting scheduled task using Command Prompt on Windows 10.

www.windowscentral.com

https://superuser.com/questions/243605/how-do-i-specify-run-with-highest-privileges-in-schtasks/243644#243644?s=50d750965b074761913a416789c7eca1 

 

How do I specify "Run with highest privileges" in SchTasks?

When I use the GUI Task Scheduler, I can easily check the "Run with highest privileges" checkbox. I found no such option in the SchTasks command line too, however. Is there a way to do that from ...

superuser.com

https://social.technet.microsoft.com/Forums/windows/en-US/c03d6691-b058-4f8d-961c-e8eba25bbaed/task-scheduler-problem-run-whether-user-is-logged-on-or-not?forum=w7itprogeneral 

 

Task Scheduler Problem (run whether user is logged on or not)

What worked for me:  Do not used the mapped drive letters.  Use the UNC rather.  So, I used a batch script to do a nightly backup job, copying files from a server to a NAS.  I do have mapped drives on the server to the NAS, Z: drive in particular.  Bu

social.technet.microsoft.com