Jump to content

unable to open snipping tool using run


Recommended Posts

i was trying to open the snipping tool on windows 10 using autoit but it does not work.

here is the code 

$sFile = ("C:\WINDOWS\system32\SnippingTool.exe")
If FileExists($sFile) Then
   Run($sFile)
Else
   MsgBox(0,'File Error', "The Windows snipping tool was not found")
EndIf

and here is the image which shows i have it

 

Capture.PNG

please tell me what to do

Link to comment
Share on other sites

  • Developers

Try running with the script with the  X64 version of Autoit3!

Jos

PS: This will work when you have the full version of SciTE4AutoIt3 installed:

#AutoIt3Wrapper_UseX64=y
$sFile = ("C:\WINDOWS\system32\SnippingTool.exe")
If FileExists($sFile) Then
   Run($sFile)
Else
   MsgBox(0,'File Error', "The Windows snipping tool was not found")
EndIf

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

21 minutes ago, Jos said:

Try running with the script with the  X64 version of Autoit3!

Jos

PS: This will work when you have the full version of SciTE4AutoIt3 installed:

#AutoIt3Wrapper_UseX64=y
$sFile = ("C:\WINDOWS\system32\SnippingTool.exe")
If FileExists($sFile) Then
   Run($sFile)
Else
   MsgBox(0,'File Error', "The Windows snipping tool was not found")
EndIf

 

thanks it worked :)

 

Link to comment
Share on other sites

Another way, if you want or need to run 32-bit is to turn off file system redirection.  

#include <WinAPIFiles.au3>

;Turn off redirection for a 32-bit script on 64-bit system.
If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False)

Global $sFile = "C:\WINDOWS\system32\SnippingTool.exe"
If FileExists($sFile) Then
   Run($sFile)
Else
   MsgBox(0,'File Error', "The Windows snipping tool was not found")
EndIf

 

Adam

 

Link to comment
Share on other sites

  • 3 years later...
On 2/14/2018 at 3:11 AM, AdamUL said:

Another way, if you want or need to run 32-bit is to turn off file system redirection.  

#include <WinAPIFiles.au3>

;Turn off redirection for a 32-bit script on 64-bit system.
If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False)

Global $sFile = "C:\WINDOWS\system32\SnippingTool.exe"
If FileExists($sFile) Then
   Run($sFile)
Else
   MsgBox(0,'File Error', "The Windows snipping tool was not found")
EndIf

 

Adam

 

This is great! solved the problem in seconds... Thank you..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...