Can not launch SnippingTool (elevation is required)
See original GitHub issueExpected Behavior
Launch SnippingTool.exe
Actual Behavior
Error log below
(PYWINA~1) f:\PCKLIB_Python\WinAutomation>python main.py
Traceback (most recent call last):
File "C:\Users\PIAODA~1\Envs\PYWINA~1\lib\site-packages\pywinauto\application.py", line 1047, in start
start_info) # STARTUPINFO structure.
pywintypes.error: (2, 'CreateProcess', 'The system cannot find the file specified.')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 8, in <module>
app = Application(backend="uia").start('C:\WINDOWS\system32\SnippingTool.exe')
File "C:\Users\PIAODA~1\Envs\PYWINA~1\lib\site-packages\pywinauto\application.py", line 1052, in start
raise AppStartError(message)
pywinauto.application.AppStartError: Could not create the process "C:\WINDOWS\system32\SnippingTool.exe"
Error returned by CreateProcess: (2, 'CreateProcess', 'The system cannot find the file specified.')
Short Example of Code to Demonstrate the Problem
I note that I tried both uia and win32 for backend of Application.
from pywinauto import Desktop, Application
app = Application(backend="uia").start('C:\WINDOWS\system32\SnippingTool.exe')
Specifications
- Pywinauto version: 0.6.8
- Python version and bitness: Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
- Platform and OS: Windows 10 64bit
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Cannot run Snipping Tool - Microsoft Community
Either go to the location and double click on the executable file or run it from start menu. Here's how: a. Go to...
Read more >SnippingTool.exe not located where it appears to be?
Start("c:\\windows\\system32\\SnippingTool.exe"); it throws an error saying "The system cannot find the file specified at System.Diagnostics.
Read more >Is Your Snipping Tool Not Working? Here's How to Fix It
The Snipping Tool is a handy way to take screenshots, but sometimes it doesn't want to work with you. Here's how to get...
Read more >Install Snipping Tool on Windows Server 2012 - Techibee.com
This did not completely enable the snipping tool – once I ran the line below, ... Hello, for the “Requires Elevation error” you...
Read more >How to detect the Snipping Tool in Windows 7? - Stack Overflow
You can use WMI to monitor process creation (and much more). This blog entry will get you started using WMI from Delphi describing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @myd7349 thanks! This is exactly the root cause. We figured it out some time ago, but I forgot to mention it here because of low priority. And thanks for the references! Really appreciate it.
The reason: You Win10 is 64-bit, and your Python app might be 32-bit. When you typied
C:\WINDOWS\system32\SnippingTool.exe, the file system redirector will redirects it toC:\WINDOWS\SysWOW64\SnippingTool.exe.To resolve this issue, we may use either of the these ways:
References: