Sending Text to Command Prompt when opened as Administrator - automationanywhere

I've managed to open Command Prompt "CMD" as Administrator
Issue is when i try to send keystrokes to it nothing happens
I tried opening CMD normally (not as administrator), it works okay
Any idea how can i make this work?
Thanks

After some digging, I think you're experiencing this do to either a malware/virus defender on your machine or a Windows UAC (User Access Control) setting. Also, try changing the elevated command prompt options like these here and see if changing QuickEdit Mode or Insert Mode has any effect on the automation anywhere control of the window. If it is determined to be a UAC issue, please refer to AA's suggestions on that here.

Related

Keystrokes command doesn't work on RDP Sessions

When I schedule a task, the Keystroke commands doesn't work, other commands like Object clonning, Log to file works fine, but Keystroke do not work.
Each Keystroke has identified the window where it should be executed. I do not know what it could be. Any Idea?
The AA version is 10.5
More than likely, you're being limited by Windows UAC (User Access Control) and DEP (Data Execution Prevention). Please see AA's documentation here for their suggestions on these two items.

Start electron app with admin privileges as default

I created an electron app which can only be started as admin, because it needs it for various command executions. Now it prompts that it must be started as admin.
This question was very helpful.
Now I want to start it with admin privileges right away so windows asks for the acception. It shouldn't be able to start the app without admin privileges.
I tried adding --win32metadata.requested-execution-level=requireAdministrator, but then it writes an error on startup (always):
The application has failed to start because the side by side configuration is incorrect.
How can I achive this with the electron packager?
Your electron-packager code looks fine, and the switch works for me.
This can happen if you are missing Visual C++ Runtimes, or if they're corrupted. Try installing them from here and try again.
If that doesn't help, then you should dig into the Event Viewer, which should come installed on your machine, and see what the specific error is. This page has some additional tips on troubleshooting this issue.

Problems with OpenProcess while not in IDE

I created an application to watch my other applications and it run perfect while I'm debugging a console or vcl application.
When I try to watch a service application it give me some problems, I noticed that I got "Access denied" when I try to "OpenProcess(PROCESS_QUERY_INFORMATION, False, PID);".
But if open my watcher by Delphi IDE I don't have this problem.
Some one know what can it be ?
My intention is to open the process to get its GetProcessTimes, to check how much of memory it's consuming.
I know that procexp.exe from SysInternal can do it without problems, some one know how do they do it ?
Tks in advice.
Obs: In my machine I disabled the UAC and I executed the watcher as administrator.
New information:
I found that to access a service as want I do to other kind of application I must use OpenService. Now I can access it without problems, now I'll search a similar command of GetProcessTimes to it.
Resolved, I continue using OpenProcess but I used PROCESS_QUERY_LIMITED_INFORMATION (0x1000) to access it. The problem was just permission, using this I can access the process and use GetProcessTimes to get what I needed.
Tks all.

Delphi: How to create a Windows autostart application like Skype does?

I'd like to add an option to my application similar to the Skype's option "run Skype as my computer starts".
Skype doesnt't go on the "Auto start applications" of the start menu folder, I'd like to have the same effect.
Note, one answer to this question suggets to add a key here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
but I checekd on my machine and Skype is not there, so another way is used.
Skype installs via a registry entry, but it's in HKEY_CURRENT_USER , not HKEY_LOCAL_MACHINE
This allows Skype to be installed or not on a per-user basis. Using HKLM will autostart for ALL users.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
If you type "msconfig" into the run window and look at the startup tab you can see where "everthing" starts from in the Location column.
I don't use skype but my guess would it's in the registry in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
You just need to add a registry entry for your app in there (and delete it if the user unticks the box)
you can use the TRegistry class to help you reading and writing to the registry.
See this question. The question is about C#, but it only involves writing a registry value. It will be easy to convert it for Delphi.
Just run msconfig and select startup tab. You'll see the applications along side the registry key used.
Oddly, when I run regedit without elevation don't see the value HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Skype also. But if I run it elevated then the value is there (I guess that Windows is playing registry redirection).
Best

(SC) DeleteService FAILED 1072

Last time I create WAS profile and WASService then I try to config and run many script for learn how to config WAS, Finally it crash so i use wasprofile delete this profile and forgot delete WASService.
Now I found IBM Webphere Application Server service display in services.msc list, so I tried to delete it with WASService.exe -remove command and windows SC command but I got message
C:\Program Files\IBM\WebSphere\AppServer\bin>sc delete "IBMWAS61Service - DEV"
[SC] DeleteService FAILED 1072:
The specified service has been marked for deletion.
make sure the service is stopped, the services control panel is closed, and no open file handles are open by the service.
Also make sure ProcessExplorer is not running.
I had a similar problem and what I did to overcome it was the following:
Stop the service: net stop "ServiceName"
Ensure: the "mmc.exe" process does not exist (The "Services" list window): taskkill /F /IM mmc.exe
Delete the service: sc delete "ServiceName"
C:\server>sc delete "ServiceName"
[SC] DeleteService SUCCESS
Now, if I execute another sc command, what I get is the following:
C:\server>sc delete "ServiceName"
[SC] OpenService FAILED 1060:
The specified service does not exist as an installed service.
But not the 1072 error message
What I've done is go to this location in regedit:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
From here, you will see a folder for every service on your machine. Simply delete the folder for the service you wish, and you're done.
N.B: Stop the service before you try this.
For some buggy reason both Event Viewer and/or Services.msc won't do a proper refresh when you tell them to!
Close them and restart, and the service would have been deleted anyway.
I had the same issue. After I closing and re-opening the Computer Management window the service was removed from the list. I'm running windows 7
In Windows 7, make sure Event Viewer closed before deleting.
I had this error also, make sure the exe the service is pointing to is stopped. Also make sure you don't have any Windows dialog boxes behind your other windows. That is why mine wasn't deleting. There was a windows message behind it saying this service has been deleted or something similar.. just had to click ok, there it went.
I had the same error due to a typo in the service name, i was trying to delete the service display name instead of the service name.
Once I used the right service name it worked fine
Logging-out and logging-in again close all blocking apps thus resolves the problem.
The 3rd party application uninstaller had removed the files for the service and then left the service in this pending deletion state.
After trying to close all applications, identifing PID of service(couldn't) for kill, logging off all other users and logging off and on, rebooting was the only fix that worked for me.
One situation where this can also happen is if there is some other service or application that is holding open a service handle obtained with OpenService. For example, a monitoring service that starts and stops services based on some external event can keep open handles to each of the services it monitors. In this case, uninstalling the service would leave it in the "marked for deletion" state until all handles obtained with OpenService are closed.

Resources