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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 running dos commands

Author  Topic 

mikejohnson
Posting Yak Master

153 Posts

Posted - 2004-12-16 : 10:08:46
here is my code, i don't get an error but it returns null. the commands i'm running run a file transfer program and the file isn't getting uploaded.

declare @lb varchar(2)
set @lb = char(13) + char(10)
declare @command varchar(2000)
set @command = ''
set @command = @command + 'set statusbat=c:\temp\foo.bat' + @lb
set @command = @command + 'del %statusbat%' + @lb
set @command = @command + 'c:\program files\valicert\stclient\stclient.exe httpsu://www.securesite.com/ c:\inetpub\test.txt /progress /RemoveOnError /quitWhenDone /statusBAT %statusbat%' + @lb
set @command = @command + ':mainloop' + @lb
set @command = @command + 'if NOT EXIST %statusbat% goto mainloop' + @lb
set @command = @command + 'call %statusbat%' + @lb
set @command = @command + 'if NOT "%FileDriveStatus%"=="DONE" goto mainloop' + @lb
set @command = @command + 'echo done!!!!' + @lb
exec master..xp_cmdshell @command

mikejohnson
Posting Yak Master

153 Posts

Posted - 2004-12-16 : 10:53:46
got it now. just wrote a batch file instead of trying to create the command/batch file on the fly
Go to Top of Page
   

- Advertisement -