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 Administration (2000)
 open Batch file using xp_cmdshell

Author  Topic 

visa123
Yak Posting Veteran

54 Posts

Posted - 2010-10-21 : 14:14:53

I have to open batch file using xp_cmdshell.
It was working fine, then all of a sudden
it's getting a return code value 128. No code has changed.

Declare @cmd nvarchar(max)
EXEC @cmd = master.dbo.xp_cmdshell 'C:\xx.bat'
select @cmd
Print @cmd

I read some articles "uninstalled antivirus and retrieve my xp_cmdshell outputs".

In my server Nod32 scanner is there.My server engg we cant uninstalled this.this is not free.

So can anyone please guide how to retrive output.

Thanks
Visa






Visa.G

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-22 : 00:37:54
what's full error msg?
Go to Top of Page

visa123
Yak Posting Veteran

54 Posts

Posted - 2010-10-22 : 06:02:21

It is not return any error Message.

It returns null and 128.


Thanks
Visa

Visa.G
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-22 : 07:42:50
This should be the return code from your xx.bat and not from Sql Server.
The meaning of 128 depends on what the xx.bat is doing.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visa123
Yak Posting Veteran

54 Posts

Posted - 2010-10-22 : 09:39:36
Thanks for your replies russell and webfred.

I have checked my service. It is upgrade to the sql server 2008.

So xp_cmdshell is working only in sql server2008.

Now i put it sql server 2008 for that alone



Visa.G
Go to Top of Page
   

- Advertisement -