How do I execute a batch file from sqlserver 2000 t-sql?

SillyM

How do I execute a batch file from sqlserver 2000 t-sql?

by SillyM » Mon, 02 Aug 2010 05:18:21

I tried the following but file dir.rpt is never created. in fact, the exec statement appears to lock-up forever.

exec xp_cmdshell 'c:\tempjunk\dir.bat'

dir.bat Contains

dir c: > c:\tempjunk\dir.rpt

This should be easy!




MAGrimsle

How do I execute a batch file from sqlserver 2000 t-sql?

by MAGrimsle » Wed, 04 Aug 2010 06:19:22

What are you trying to do with the batch file, i.e, what does it contatin

Michael



Manivannan.D.Sekara

How do I execute a batch file from sqlserver 2000 t-sql?

by Manivannan.D.Sekara » Thu, 05 Aug 2010 08:21:24

Do you get any output on the Query Analyzer/Management Studio




Busha

How do I execute a batch file from sqlserver 2000 t-sql?

by Busha » Fri, 06 Aug 2010 07:20:23

Hope you are looking on the same directory c:\tempJunk on which SQL Server is installed