Share via

How to open and close Windows camera app from Command Prompt?

Anonymous
2021-11-18T19:25:00+00:00

I looking for a way to open & close Windows Camera app from the command line. Use case is to run reliability tests for my camera project and for this I may need to open and close camera app multiple times. If there is a command I was hoping to make a batch script to automate the process.

Thanks!

Windows for home | Windows 10 | Settings

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2021-11-19T21:09:24+00:00

    I found a quick way to do what I needed.

    :loop_begin
    
    start microsoft.windows.camera: 
    
    timeout /t 2  
    
    taskkill /im WindowsCamera.exe /t /f
    timeout /t 2  
    goto :loop_begin
    
    20+ people found this answer helpful.
    0 comments No comments
  2. DaveM121 872.1K Reputation points Independent Advisor
    2021-11-18T19:57:08+00:00

    Hi AshwinN9

    I am Dave, I will help you with this, below is the command you need.

    start microsoft.windows.camera:

    10 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2021-11-19T08:04:10+00:00

    Thanks a lot for your reply Dave.

    Let me google around a bit.

    Regards!

    1 person found this answer helpful.
    0 comments No comments
  4. DaveM121 872.1K Reputation points Independent Advisor
    2021-11-18T20:25:53+00:00

    Hi AshwinN9

    No I do not know of a command to do that, usually when an application is loaded into RAM, that then is assigned a Process ID and you would need to find that to end the process, and that process ID would change each time the camera app is opened.

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2021-11-18T20:12:11+00:00

    Hi Dave,

    Thanks for your reply!

    Is there a similar command to stop/close the camera app?

    Thanks again!

    1 person found this answer helpful.
    0 comments No comments