I would like to use autohotkey to make a key binding that pastes my admin password into the admin prompts so I don't have to type it out 100 times a day. At the moment I have a AHK script that will paste text in most programs but it doesn't work in things like active directory or the windows admin prompt for credentials.
Can anyone help me with this?
here's my current script. When I press cntrl+J it pastes the testadminpass text but not into the password prompts
^j::
send, TestAdminPass
return
If the application, browser or terminal runs with elevated admin privileges and ahk script is not then you can't send strings or expand hotkeys.
To solve this, simply run your script.ahk as Run as administrator.
Related
So I have an app that runs shell command twice, once to disable sleep and then a few moments later to enable sleep. The code looks as follows:
NSAppleScript(source: "do shell script \"sudo pmset -a disablesleep 1\" with administrator " +
"privileges")!.executeAndReturnError(nil)
// and then same code with with '0' instead of 1 to disable it
However the issue is I don't want the user to enter their password EVERYTIME they call these commands. It's making for a poor user experience. Is there a way I can grant the entire app admin privilege and run shell commands however I want? Or is there a way to run this shell command without the user authorization?
I'm new on Powershell scripting and i've one issue.
When i start scripting, my stuff runs well but since yesterday, the script execution runs differently than before.
Now :
The console print all the variables values when not ask
Open pop-up for read-host command (this is a console application)
The securestring isn't decrypt by the application anymore
"Enter" key must be pressed 2 times to enter values when the script
runs
Some commands are not found
Any ideas guys?
Thank you (and excuse my poor english ^^)
There is an application to search WHOIS database directly:
https://technet.microsoft.com/en-us/sysinternals/bb897435
When I opened it at first time, I accepted the agreement, but closed it immediately after that. Now, each time I try to open this app, it opens and closes immediately. Same happens on another laptop.
What is the problem?
It is a command line tool. You should use the command prompt (dos prompt) to use it. Open the command prompt by pressing the Windows Key + R, type CMD and press enter.
Then navigate to the folder where you extractd the zip file and type:
whois -v stackoverflow.com
And you get the whois information
Is it possible to substitute AltTab with only one key press ?
i tried this one but it doesn't work
`::AltTab
I use this, you may need to change the Sleep delay.
`::
Send {Alt Down}{Tab}
Sleep 100
Send {Alt Up}
return
I am running Windows 8.1 64-bit and AutoHotkey v1.1.16.05. And my C:\Program Files\AutoHotkey\AutoHotkeyU64.exe is digitally signed by running the script described here (EnableUIAccess.zip) so that Windows allows it to simulate Alt+Tab. The digital sign is required if you are using Windows Vista and onwards.
Download the zip file and extract it. Then run EnableUIAccess.ahk:
It will ask which AutoHotkey executable to sign. Pick one that you need (AutoHotkeyA32.exe, AutoHotkeyU32.exe, AutoHotkeyU64.exe or AutoHotkey.exe).
Then it will ask to save the new executable. You can choose to overwrite the original file or save as another executable.
Finally it will ask to create a "Run Script with UI Access" context menu item. If you choose 'Yes', then you can right-click a .ahk file and choose "Run Script with UI Access", which will use the digitally signed executable to run the .ahk file. But if you choose to overwrite the original file in step 2, then it is not necessary to create this context menu item.
From the docs:
Each Alt-Tab hotkey must be a combination of two keys, which is typically achieved via the ampersand symbol (&).
http://ahkscript.org/docs/Hotkeys.htm#AltTabDetail
You might even be able to avoid messing around with UIAccess and administrator privileges. This works for me on Windows 8.1:
`::Run "C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Window Switcher.lnk"
And for others who are struggling with getting a two-key combination working on Windows 8 or 10, here's an example using Ctrl-Tab to trigger the window switcher:
^Tab::
Run "C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Window Switcher.lnk"
SetTimer EnterOnKeyUp, -1
return
EnterOnKeyUp:
WinWaitActive ahk_class TaskSwitcherWnd
KeyWait Ctrl
Send {Enter}
SetTimer EnterOnKeyUp, Off
return
* Inspired by: Fully Working Alt Tab Win 8
Perhaps I should be asking this on Superuser, but there are many other Emacs questions here so I thought I would try my luck.
I use GNU Emacs 23.2.1 on Windows 7 with User Access Control enabled.
In Emacs, I would like to make changes to some admin files (eg. hosts file). However, on attempting to save the file I get a warning that I do not have permission to write to the file.
Is there a way to get Emacs to escalate to the admin user for editing these files ?
You could always just admit defeat and run the emacs session with elevated privileges.
There's a bunch of ways to do this, and this page lists them, including automatically running stuff as administrator.
This is probably not quite what you want. Otherwise you might create a script that gets a filename as it's first argument, and then just bind that program to a shortcut or something, like admin-save.
If you give that administrator rights, and then call the file with the buffer name as it's first argument and it's destination as it's second, you should be good.
The script could be a simple BATfile, something ala (I'm not on a Windows box so I can't test it for myself)
:: Administrator-copy.bat copies a file with adminstrator privileges.
:: Remember to give it administrator privileges!
: START
COPY %1 %2
: END
But that's a rather clunky solution though.
How to elevate an already running application I do not know.