I've created a WPF Window with a lot of buttons, each of them run a different program. To run MS Word, for instance, I used:
System.Diagnostics.Process.Start("C:\\Program Files (x86)\\Microsoft Office\\Office14\\WINWORD.EXE");
But when I try to run the Windows 7 Snipping Tool the same way it doesn't work. It was supposed to be like this:
System.Diagnostics.Process.Start("C:\\Windows\\System32\\SnippingTool.exe");
I'm sure the path is correct, but always appears a message saying the file wasn't found. I would like to know why is this happening.
Important: I use Windows 7 64 bits.
Restart the Windows File Explorer As such, restarting File Explorer may dislodge whatever's keeping the Snipping Tool from working correctly. To do this, press Ctrl + Alt + Del, then select Task Manager. Alternatively, you can press CTRL + Shift + ESC to jump directly into the Task Manager.
In some cases, when the snip and sketch app does not work, the issue can be related to the app's data on your system. In such a scenario, you will have to simply reset the application on your system which will delete the app's data on your system.
Use this:
// if the build platform of this app is x86 use C:\windows\sysnative
if(!Environment.Is64BitProcess)
System.Diagnostics.Process.Start("C:\\Windows\\sysnative\\SnippingTool.exe");
else
System.Diagnostics.Process.Start("C:\\Windows\\system32\\SnippingTool.exe");
The problem is in your build platform (x86) and the automatic redirection of the folder C:\Windows\System32\
on 64-bit OS'es.
Basically, for several reasons, in vista/windows 7 64-bit OS'es when a 32 bit application try to access to C:\Windows\System32\
it is automatically redirected to the folder called C:\Windows\SysWOW64\
. Hence, you cannot start snippingtool.exe
because it is not present in that folder.
The only way is to use C:\Windows\sysnative\
and bypass the redirection.
My psychic debugger tells me that you are running a 32-bit program on a 64-bit version of
Windows, so your call to %WINDIR%
(C:\Windows
) is actually being re-routed to C:\Windows\SysWOW64
.
Use the environment variable instead of hard-coding paths to directories that may move around depending on the environment and/or Windows version..
You should use an environment variable instead. Likely you are running it on a 64 bit system and C:\Windows\System32\
is getting redirected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With