Jump to content
akshatgupta

unable to open snipping tool using run

Recommended Posts

akshatgupta

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

Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
akshatgupta
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 :)

 

Share this post


Link to post
Share on other sites
AdamUL

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

 

Share this post


Link to post
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

×