February 7, 2012 at 12:09 am
Hello.
I have an sa Privilege in a sql server and i wanna run internal commands(For example : 'dir c:') in a linked server through xp_cmdshell.
How can i do it?
Have any ideas to run commands in a linked server with command prompt ?
Best regards.
February 7, 2012 at 2:59 am
Depending on exactly you want to accomplish, look at the options from SQLCMD, Powershell, Dos Batch Files...
Your posts heading "....run xp_cmdshell...." and content "...dir c:..." confuse me a bit.
Warning: xp_cmdshell is disabled by default for a VERY good reason....try to avoid using it....especially as 'sa'...
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
February 7, 2012 at 5:01 am
I need something to run system commands in my linked server only in cmd.exe(Not with GUI programs and etc.) and I think xp_cmdshell is the best one.
I should tell this again... I am the sa of Database A and I Linked Database B to A(There is no RDP or other programs between A and B)
Now.. How can I run system commands(DIR for example) in Database B?
(BTW I can accept all the risks)
February 7, 2012 at 5:04 am
If SQLCMD or Powershell can help me in this case, please gimme the exact statement of Query...
thanks...
February 7, 2012 at 10:34 pm
http://lmgtfy.com/?q=powershell+
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply