You have to login in order to post a reply to this topic.

2 replies [Last post]
GMarkham
GMarkham's picture
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 07/31/2010
Posts: 10

I'm trying to create a script using the Macro Record feature which will begin by launching a program first.  There's a problem, though.  This program needs to be run as Administrator and requires UAC authorization to do so.

I did a little homework and happened upon this site which explains how to create a task using Task Scheduler, ensuring that you run it using highest privileges possible, then create a shortcut that will call that task.  I thought it was a pretty elegant solution (if not exactly "secure").  I tested it out and it works great -- no UAC prompt.

The problem comes about when trying to launch this shortcut from the WinAutomation macro recording tool.  I get a very unhelpful error which simply states "Failed to launch application..."

I've been playing with this for a couple of hours and have exhausted all of my options.  Hopefully you guys can help.

 

Thanks,

Greg

codex
codex's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Joined: 11/12/2009
Posts: 161
Re: Unable to run a command before start of Macro Recorder

I think there are many ways to do that. However, I would suggest that you do the following:

1) Right click on the tray icon (bottom right corner) of WinAutomation and select Exit WinAutomation (console must be closed for this to happen).

2) Now instead of clicking on the "WinAutomation Console" link to launch WinAutomation, right click on it and select "Run As Administrator". This will basically launch the DIAgent with administrative privileges and thus, all jobs will be executed with administrative privileges.

Do note, that in order to make all your jobs run with administrative privileges every time, you will have to make sure that the process that the process: WinAutomation.DIAgent.Exe that launches on startup, is run with administrative privileges. Basically, this is the process that determines which credentials a job will use when it is executed.

__________________

Error is not blindness, error is cowardice

__________________

Error is not blindness, error is cowardice

GMarkham
GMarkham's picture
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 07/31/2010
Posts: 10
Re: Unable to run a command before start of Macro Recorder

Brilliant!  I would not have though of that.  Thank-you, Codex.