chrislindsay
asked on
Using a hta file with MSSQL agent to schedule a script job
Hi Experts,
I am trying to execute a hta file using
EXEC master..xp_CMDShell "C:\Users\superuser\Deskto p\queue.ht a" in SQL server agent.
The hta file contains :
<HTML><HEAD></HEAD>
<FRAMESET ROWS="100%"> <FRAME NAME="doit" SRC="https://abc.com/queue" onload="window.close();">
</FRAMESET>
</HTML>
The file executes when initiated manually from the desktop but I cannot get it to work inside an SQL job.
I am using a T-SQL scrip inside the job. THe job runs but nothing happens...
Im not sure this a security issue as the job agent is running as an windows adminstrator.
I have tried using CMDEXEC running as an SQL service accont agent but I think this is a securtiy issue and can't complete the job..
Any tips would be helpful thanks...
I am trying to execute a hta file using
EXEC master..xp_CMDShell "C:\Users\superuser\Deskto
The hta file contains :
<HTML><HEAD></HEAD>
<FRAMESET ROWS="100%"> <FRAME NAME="doit" SRC="https://abc.com/queue" onload="window.close();">
</FRAMESET>
</HTML>
The file executes when initiated manually from the desktop but I cannot get it to work inside an SQL job.
I am using a T-SQL scrip inside the job. THe job runs but nothing happens...
Im not sure this a security issue as the job agent is running as an windows adminstrator.
I have tried using CMDEXEC running as an SQL service accont agent but I think this is a securtiy issue and can't complete the job..
Any tips would be helpful thanks...
ASKER
Hi Chaau,
When I run the query in a Query window, the query just hangs and necer finishes.
This also happens when you place the query in an sql job and exectue it.
The script runs from the desk top so I think it is a security issue but not sure how to fix it?
Thansk Chris
When I run the query in a Query window, the query just hangs and necer finishes.
This also happens when you place the query in an sql job and exectue it.
The script runs from the desk top so I think it is a security issue but not sure how to fix it?
Thansk Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for the delay. It was a permissions thing thanks works now
Open in new window
The same rule applies to the hta file. An HTA is executed using the program mshta.exe, so the correct syntax will be:Open in new window