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
 Transact-SQL (2000)
 xp_cmdshell not running winmsd.exe /f

Author  Topic 

simonw2003
Starting Member

11 Posts

Posted - 2005-07-04 : 05:05:34
Im having problems getting this to work:

--
DECLARE @cmd sysname, @var sysname
SET @var = 'winmsd.exe'
SET @cmd = @var + ' /F'
EXEC master..xp_cmdshell @cmd
--


And have tried a simpler version:

exec master..xp_cmdshell 'c:\winnt\winmsd.exe /F'


Is there a work around for this, or is it simply not possible. I have tried remote and also logged in locally on the SQL server. Both SQL7 and 2000 tested.

Thanks

Simon

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-04 : 06:31:55
It is advisible not to run exe through SQL query

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

simonw2003
Starting Member

11 Posts

Posted - 2005-07-04 : 06:46:07
I understand that its unadvisable, however the option is there and if anyone knows how get the above to work please let me know.

Many thanks

Simon
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-04 : 06:54:38
Can you explain why you want it to be run through SQL query?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

simonw2003
Starting Member

11 Posts

Posted - 2005-07-04 : 06:56:52
We administer SQL servers on many sites, over 100. The command produces a diagnostic text file. Being able to generate this remotely via sql would be very convenient, and allow for automation of tasks that take real people a long time to perform.
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-07-04 : 12:44:56
Have you tried using the /report option? Also, are these Windows 2000 or 2003 servers?

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2005-07-04 : 15:32:48
quote:
Originally posted by madhivanan

It is advisible not to run exe through SQL query

Madhivanan

Failing to plan is Planning to fail



why is this unadvisable?


EDIT:
looks like Derrick has answered your question. Running apps with a GUI doesn't seem to work with xp_cmdshell, since you cannot interact wiht the buttons and such. Everything needs to be command line driven for things to work smoothly.





-ec

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-05 : 01:07:32
quote:
why is this unadvisable?


Because It will slow down SQL Server

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

simonw2003
Starting Member

11 Posts

Posted - 2005-07-05 : 03:01:25
It was sql 7 and 2000 tested on. Win2k sp3 sp4 server and NT sp6a OS tested on.

The exe in question when supplied /f is autonomus - but I guess as a gui progress bar still "pops up" perhaps SQL will not allow this to run.

Thanks anyway for the help people.

Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-07-05 : 19:13:48
The xp_cmdshell will not allow any GUI at all, so your are correct.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -