Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Execution of command using xp_cmdshell

Author  Topic 

sek
Starting Member

27 Posts

Posted - 2010-10-05 : 12:29:01
Hi,

I want to execute the executable(DTExec.exe) using master..xp_cmdshell which is located in the following path.

C:\Program Files\Microsoft SQL Server\90\DTS\Binn

when I try to execute the stored procedure I am getting the following error due to the spaces in the path.

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
NULL

Is there any way to keep the path as it is with spaces???

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-05 : 12:33:13
Try giving the value in double quotes

"C:\Program Files\Microsoft SQL Server\90\DTS\Binn"
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-05 : 12:33:28
"C:\Program Files\Microsoft SQL Server\90\DTS\Binn"

But why use xp_cmdshell instead of sql agent job for this?
Go to Top of Page
   

- Advertisement -