AutoHotkey ImageSearch failing to find matches - autohotkey

I have servers with an AutoHotkey script running on them, that I access via TeamViewer.
Sometimes AutoHotkey fails to match an ImageSearch even when the image it matches is captured from the displayed screen using Windows' Snipping Tool.
This only happens on some servers but not others. I have tried using ImageSearch *n shade variation, to no effect.
What could be causing the issue?

This can happen when TeamViewer is allowed to choose its own quality settings based on your connection to the server. If TeamViewer decides to use low quality settings for a connection, it will enable the Windows Basic Theme on the remote computer, potentially breaking AutoHotkey ImageSearch for some types of windows.
You can solve this by selecting custom settings in your own TeamViewer options when connecting to other clients.
Go to Extras -> Options -> Remote Control
Select Custom Settings from the Quality dropdown.
Slide both sliders to the max (the right).
Enable the Aero color scheme.
Disconnect from any open sessions and when you next connect, TeamViewer will not set the theme to Windows Basic.

Related

Allow Safely Remove Media in GPO

I have a system that I want to lock down, only running certain programs.
All is working so far when I use "Run only specified Windows applications" (under Local Computer\User Configuration\Administrative Templates\System) except when I try to add an option to remove media.
I have the policy enabled with a list of all applications I want to be able to load. And this: "rundll32.exe shell32.dll, Control_RunDLL HotPlug.dll"
but when I run my shortcut for this I just get the error "This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator"
I saw someone online with a similar problem with rundll32.exe but that was with a printer and they got it working by adding a printui.dll. Am I missing something or doing something wrong or is this not possible? I need this option because I have to disable right click in our locked down system.

Active Screen Reader

Every time I open a new folder or restart my laptop I see an "Screen Reader Detected" warning in my terminal window.
I have also tried turning "off" the accessibility Support in the terminal setting, but still no luck.
Is there any way to solve this problem. Or maybe a way to detect the screen reader so that I can turn it off.
Note: I have not installed any external screen readers. I also have turned "off" the "Narrator" in my windows 10 machine.
This can happen if you have any accessability tools installed on your device like NVDA (non-visual desktop access), and also some web dev suites as they will often include accessibility assessment tools.
These tools will toggle a registry value that can 'light up' accessibility features on apps that are designed with this in mind.
The specific key to check is here, which you can navigate to with regedit.exe:
HKEY_CURRENT_USER\Control Panel\Accessibility\Blind Access
if you have the Key On with a value of 1, then this will trigger the warning.
To remove the warning, simply set the key to 0. You can do this with PowerShell or the old school reg command.
reg add "HKCU\Control Panel\Accessibility\Blind Access" /V On /d 0
Source: https://github.com/PowerShell/PowerShell/issues/11751

Change Epson Cash Drawer setting

I'm looking for a way to change the settings that control the cash drawer either with powershell, vbscript, batch, etc. We have over 40 stores with several registers each. All of those receipt printers were originally configured to open the cash drawer before each print. I have updated our POS software such that it now sends the correct code to prompt the printer to open the drawer only when it is needed (cash transaction, not credit/debit). I'm looking for a way to update the driver setting for all of these printers without having to manually adjust each one. The computers are running Windows 7.
I have tried using PowerShell with some combination of Get-Printer and Set-PrinterProperty, but those cmdlets are not available with Windows 7. I've tried using cscript prncnfg.vbs, but there are no configurable settings options with that command that I could use for this specific settings.
There are only so many places that settings can be saved (Registry, File...). Use Sysinternal's Process Monitor to monitor where the setting is changed.
Start the application.
Just before you go to configure the setting, start capturing in Process Monitor.
Make the change to the setting.
Stop capturing in Process Monitor.
Filter by the PID or Process Name.
Look for write operations to the registry or a file that might represent that setting in your application.
Verify the setting by making changes manually and checking in the application GUI.
You can then use batch, Powershell, VBS, DSC, SCCM or whatever to make that change for all of your clients.

Automate Dual Monitor Setup In Vista

I use a laptop as my primary workstation. Sometimes I work alone on it, but a significant portion of the time, I'm at my office desk and I hook up an external monitor to increase my workspace.
Every time I perform this action, I click the same dialog boxes in Windows Vista to setup the dual screen and position the window. It seems like a repeatable task that I could automate.
I'd like to be able to plug in my monitor cable, double click a program and have it automatically configure the monitor.
What type of program could do this? I haven't found much online that relates. I'm thinking of trying an autohotkey script, or the Windows Accessibility API with PowerShell. Has this problem already been solved?
Clarification: I'm specifically looking to automate the steps I use with my mouse that invoke the base functionality in Windows Vista.
Right click on desktop
Select Personalize in context menu
Click display settings
Click monitor #2, then click checkbox to "Extend desktop to this monitor"
Click and drag monitor #2 to the left of monitor #1
Click OK to close the dialog
Click Yes in the subsequent pop up to accept these monitor settings
Update: Windows 7 does this automatically
I just upgraded to Windows 7 and it remembered my dual monitor settings. I set them once at work as listed above, then unplugged and worked at home over the weekend. I came in on Monday morning, booted up, plugged in and whammo! It just worked. Thanks Windows 7!
I haven't seen an existing utility that does this but it would be pretty easy to write one using the Win32 APIs. Via this page, EnumDisplayDevices gets a list of display devices, EnumDisplaySettingsEx gets the current settings and ChangeDisplaySettingsEx will make the changes.
The DEVMODE.dmPosition field should contain the virtual coordinates of the top left corner of the display, with the primary monitor always being (0,0) and the others relative to that.
The tool would need two modes, the first saves the current settings to a config file, and the second applies the settings from the config. I'd store/retrieve only the display device index, name, and each of the DEVMODE.dm* fields mentioned in the ChangeDisplaySettingsEx docs. A text-based config allows for hand-edits.
Try UltraMon for excellent dual monitor support. I've been using it for years on a number of different laptops and desktops and it works great. I've only used XP so I am not sure how it works with Vista.
My Leovo T60p does this automatically without any special steps. Try upgrading your video drivers, and check the manufacturer's site for any utilities that can do that.
If you have windows vista or 7 you could hit the windows_key + P. You have a bunch of options to select including extend
I believe Ultramon would in fact work. In the right-click menu on the Ultramon icon in the systray there is a "disable/enable secondary" command.
I think you could simply:
plug in the second monitor
select "enable secondary"
Here I am, three years later, answering my own question! Yay!!!
This is easily scripted with http://www.autohotkey.com
Here's an example script for swapping between one monitor and two monitors with Windows+1 and Windows+2. AutoHotKey also allows for click and drag behavior that would be needed to swap the position of the second monitor.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#1::
Send {LWin}
WinWaitActive Start menu
Send Adjust Screen Resolution
Send {enter}
WinWaitActive Screen Resolution
ControlClick ComboBox3
Send {PgDn}
Send {Up} ; Select "Show desktop only on 1"
Send {enter}
Sleep 3000 ; workaround - cannot select accept/revert window?
Send {left}
Send {enter} ; accept changes
Return
#2::
Send {LWin}
WinWaitActive Start menu
Send Adjust Screen Resolution
Send {enter}
WinWaitActive Screen Resolution
ControlClick ComboBox3
Send {PgDn}
Send {Up}
Send {Up} ; Select "Extend these displays"
Send {enter}
Sleep 3000 ; workaround - cannot select accept/revert window?
Send {left}
Send {enter} ; accept changes
Return

User Initiated Kernel dump in Windows XP

I remember watching a webcast from Mark Russinovich showing the sequence of keyboard keys for a user initiated kernel dump. Can somebody refresh my memory on the exact order of the keys.
Please note this is for XP.
http://psacake.com/web/jr.asp contains full instructions, and here's an excerpt:
While it may seem odd to think about purposefully causing a Blue Screen Of Death (BSOD), Microsoft includes such a provision in Windows XP. This might come in handy for testing and troubleshooting your Startup And Recovery settings, Event logging, and for demonstration purposes.
Here's how to create a BSOD:
Launch the Registry Editor (Regedit.exe).
Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters.
Go to Edit, select New | DWORD Value and name the new value CrashOnCtrlScroll.
Double-click the CrashOnCtrlScroll DWORD Value, type 1 in the Value Data textbox, and click OK.
Close the Registry Editor and restart Windows XP.
When you want to cause a BSOD, press and hold down the [Ctrl] key on the right side of your keyboard, and then tap the [ScrollLock] key twice. Now you should see the BSOD.
If your system reboots instead of displaying the BSOD, you'll have to disable the Automatically
Restart setting in the System Properties dialog box. To do so, follow these steps:
Press [Windows]-Break.
Select the Advanced tab.
Click the Settings button in the Startup And Recovery panel.
Clear the Automatically Restart check box in the System Failure panel.
Click OK twice.
Here's how you remove the BSOD configuration:
Launch the Registry Editor (Regedit.exe).
Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters.
Select the CrashOnCtrlScroll value, pull down the Edit menu, and select the Delete command.
Close the Registry Editor and restart Windows XP.
Note: Editing the registry is risky, so make sure you have a verified backup before making any changes.
And I may be wrong in assuming you want BSOD, so this is a Microsoft Page showing how to capture kernel dumps:
https://web.archive.org/web/20151014034039/https://support.microsoft.com/fr-ma/kb/316450
As far as I know, the "Create Dump" command was only added to Task Manager in Vista. The only process I know of to do this is using the adplus VBScript that comes with Debugging Tools. Short of hooking into dbghelp and programmatically doing it yourself.
You can setup the user dump tool from Microsoft with hot keys to dump a process. However, this is a user process dump, not a kernel dump...
I don't know of any keyboard short cuts, but are you looking for like in task manager, when you right click on a process and select "Create Dump"?