로그인 사용자가 아닌 다른 사용자로 프로그램 실행하기


윈도우 컴퓨터에서 메모장(notepad.exe) 프로그램을 실행하는 경우에는 현재 로그인 한 사용자 계정으로 실행하게 된다.

만약 로그인 하지 않은 다른 사용자 계정으로 실행하고자 한다면 다음과 같이 하면 된다.
1) cmd.exe (또는 Windows 키 + R)
2) runas /user:jesuswithme notepad.exe
runas /user:mydomain\administrator notepad.exe
runas /user:localhost\administrator powershell.exe
runas /user:mydomain\administrator /noprofile sqlcmd.exe

이러한 작업이 필요한 이유는 배치 파일이나 스크립트를 실행할 때 다른 사용자 계정으로 해당 파일을 실행할 때 도움이 된다. 즉, 스크립트의 내용이 실행될 때 현재 로그인한 계정이 아닌 다른 계정이 필요한 경우, 이와 같이 작업을 하면 되는 것이다

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s