Hi,
I had followed the following steps and it works. You can try the same.
1) Create a test.bat file in c:\temp directory as follows.
@echo off
copy test.bat test1.bat
2) now at isql prompt write the following command and execute.
exec master..xpcmdshell "c:\temp\test.bat"
It will run the batch file and you will find a new file test1.bat in your c:\temp directory.
NOTE: Please be sure that you had created the test.bat file on the machine where sql server is running. Else if you want to create it on any other machine then follow the following steps.
Let us say your machine is 'myMachine' and it have a share name called temp which points to c:\temp
then,
1) Create a test.bat file on <myMachine> in c:\temp directory as follows.
@echo off
copy test.bat test1.bat
2) now at isql prompt write the following command and execute.
exec master..xpcmdshell "\\myMachine\temp\test.bat"
I hope this will help you in right direction.