all groups > sql server dts > june 2004 >
You're in the

sql server dts

group:

xp_cmdshell


xp_cmdshell Paul
6/24/2004 8:46:57 PM
sql server dts:
Hi, When I run xp_cmdshell in an ActiveX script that is
executed within a DTS package, I get the following error...

"Type Mismatch : 'xp_cmdshell' "

The below line is what I execute ....

xp_cmdshell 'open c:\test\blah.bat', no_output

I have tried different variants of the above to no avail.
It did work once , yeah weird, now it wont run at all.

Just wondering what I am doing wrong. Many thanks in
advance.

Paul

Re: xp_cmdshell Darren Green
6/25/2004 6:47:31 AM
In message <214bf01c45a67$106fcbf0$a401280a@phx.gbl>, Paul
<anonymous@discussions.microsoft.com> writes
[quoted text, click to view]

xp_cmdshell is a T-SQL command, so it cannot be used directly in ActiveX
Script. You sure you were not using an Execute SQL Task previously when
it worked?

If you really want to execute T-SQL inside an ActiveX Script then you
need to wrap the command in an ADO call, but the Execute SQL Task is
after designed for the job, and therefore simpler.

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
Re: xp_cmdshell Paul
6/27/2004 3:24:03 PM
Darren, Thanks for your reply, yes of course , I got quite
myopic on this and consequently realised TSQL, naturally I
used SHELL from VBSCRIPT quite successfully.
Many thanks again
Paul

[quoted text, click to view]
AddThis Social Bookmark Button