xp_cmdshell

Tags:
SQL Server
hai everybody.. while executing the following procedure.. exec master..xp_cmdshell 'dir c:*.*' iam getting the folders which existing in server..i.e. in which sql server is installed. but i need to access the informaiton of folders existing in client machine i.e. which i operate from another local machine.. can any one help me out..
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can do this by passing a network share to the xp_cmdshell. However it requires that the Windows account which is running the SQL Server to have access to the remote machine.

It would be much better to use some client side code to look at the files and folders on the client machine, then pass what ever data is needed to the SQL Server.

It’s a security hole to use the xp_cmdshell, as it allows unauthorized people to have potential access to files and folders they shouldn’t have access to.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: