Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

How to launch Snipping Tool in Vista using AutoHotKey?


  • Please log in to reply
22 replies to this topic
Anusha
  • Members
  • 4 posts
  • Last active: Aug 21 2007 06:53 AM
  • Joined: 21 Aug 2007
I'm new to AutoHotKey. At the moment, I'm using it to launch apps using shortcut keys.

I included

^!s::run "c:\windows\system32\SnippingTool.exe"

in my script. Compiled fine. But when I press the shortcut keys, I get this error:
Posted Image

What can I do to get it to work?
Anusha

BoBo¨
  • Guests
  • Last active:
  • Joined: --
I'd guess that Vista won't allow to execute that exe from within that OS system folder for security reasons. Have a try with RunAs or to run that exe from within another destination.

Anusha
  • Members
  • 4 posts
  • Last active: Aug 21 2007 06:53 AM
  • Joined: 21 Aug 2007
Weird thing is that Snipping Tool doesn't seem to work when it is not in the System32 folder. I'm running as a limited user. But even when I try to run it as Admin from another location, it still doesn't work.

Probably I'm out of luck. I don't want to run it with elevated privileges because it will take longer than running it from the startment (i.e. have to enter password etc.)
Anusha

BoBo¨
  • Guests
  • Last active:
  • Joined: --

i.e. have to enter password etc.

using AHK's RunAs you shouldn't have to do it manualy, right?

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Wow, didn't know about that tool!

I tried the following script:
Run, "C:\Windows\System32\SnippingTool.exe"
It worked fine, and did not need administrative priveleges.

I see "Program Files (x86)" in your screenshot - are you on 64-bit Vista? I think any attempts by 32-bit apps to access "windows\system32" are redirected to "windows\SysWOW64". If this is where your script is going wrong, I suggest you read: Selectively suppress Wow64 filesystem redirection on Vista x64 with ‘Sysnative’

Fortunately, Vista adds a “backdoor” to Wow64 filesystem redirection, in the form of a pseudo-directory named “Sysnative” that is present under the Windows directory (e.g. C:\Windows\Sysnative). This pseudo-directory is not visible in directory listings, and does not exist for native 64-bit processes. For Wow64 processes, however, it can be used to access the 64-bit system32 directory.

So I suppose you could try:
Run, "C:\Windows\Sysnative\SnippingTool.exe"
(I'm on 32-bit Vista, where this doesn't apply.)

BoBo¨
  • Guests
  • Last active:
  • Joined: --
SnippingTool seems to be part of Vistas Tablet PC funtionality (that's what Google says about it).
I'd be really interested how to use it with a standard Desktop PC (maybe on XP too ?).

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
FYI, it works fine on my "standard Desktop PC" with Vista Business.

Edit: You're right - Microsoft also says its a Tablet PC feature. It seems Vista Basic is the only version of Vista that doesn't include it, though.

BoBo¨
  • Guests
  • Last active:
  • Joined: --
What I get running SnippingTool with XP:
"..\SnippingTool.exe is not a valid Win32 application."

:?

JackieKu
  • Guests
  • Last active:
  • Joined: --
Here is a script might be help.
IsWow64Process()
{
	hProcess := DllCall("kernel32\GetCurrentProcess")
	ret := DllCall("kernel32\IsWow64Process", "UInt", hProcess, "UInt *", bIsWOW64)
	return ret & bIsWOW64
}

Wow64EnableWow64FsRedirection(bEnable)
{
	ret := DllCall("kernel32\Wow64EnableWow64FsRedirection", "UInt", bEnable)
	return ret
}

Wow64DisableWow64FsRedirection()
{
	ret := DllCall("kernel32\Wow64DisableWow64FsRedirection", "UInt *", OldValue)
	return OldValue
}

Wow64RevertWow64FsRedirection(OldValue)
{
	ret := DllCall("kernel32\Wow64RevertWow64FsRedirection", "UInt", OldValue)
	return ret
}


MyGreyGoose
  • Guests
  • Last active:
  • Joined: --

Fortunately, Vista adds a “backdoor” to Wow64 filesystem redirection, in the form of a pseudo-directory named “Sysnative” that is present under the Windows directory (e.g. C:\Windows\Sysnative). This pseudo-directory is not visible in directory listings, and does not exist for native 64-bit processes. For Wow64 processes, however, it can be used to access the 64-bit system32 directory.

So I suppose you could try:
Run, "C:\Windows\Sysnative\SnippingTool.exe"
(I'm on 32-bit Vista, where this doesn't apply.)


That worked exactly right. (I'm on Vista x64 and was having the same problem)

Meetloaf
  • Members
  • 46 posts
  • Last active: Mar 05 2016 07:57 PM
  • Joined: 02 Jun 2008
MOST awesome...THANKS!

anon
  • Guests
  • Last active:
  • Joined: --

Fortunately, Vista adds a “backdoor” to Wow64 filesystem redirection, in the form of a pseudo-directory named “Sysnative” that is present under the Windows directory (e.g. C:\Windows\Sysnative). This pseudo-directory is not visible in directory listings, and does not exist for native 64-bit processes. For Wow64 processes, however, it can be used to access the 64-bit system32 directory.



Thank you thank you thank you!!! I've been wondering forever why I couldn't create a keyword to launch the Snipping Tool, nor StikyNot (i'm using executor).

Worked perfectly!!

C:\Windows\Sysnative\SnippingTool.exe
C:\Windows\Sysnative\StikyNot.exe

sweeeet!!!!

Sarahendipity
  • Guests
  • Last active:
  • Joined: --
I am running Vista 64, and I don't have a sysnative folder... Odd thing is that it used to open fine and now it's not... same with IE x86, but that's no biggy.

Meetloaf
  • Members
  • 46 posts
  • Last active: Mar 05 2016 07:57 PM
  • Joined: 02 Jun 2008
Works in Win 7 x64, odd that yours was working, and now it is not.

Sarahendipity
  • Members
  • 1 posts
  • Last active: Jul 09 2009 04:51 PM
  • Joined: 09 Jul 2009
I realized I left information out. >.< My apologies. When I goto Run "C:\Windows\Sysnative\SnippingTool.exe" I get the following error:

C:\Windows\Sysnative\ refers to a location that is unavailble. It could be on a hard drive on this computer, or on a network. Check to make sure that the disk is properly inserted, or that you are connected to the Internet or your network, and then try again. If it still cannot be located, the information might have been moved to a different location.

I am running as Admin... So I'm at a loss. :(