Hi
Trying to work on a script which is able to list files on a remote server
and its drive but unsure of the syntax. Can anyone advise as below doesnt
work.
xp_cmdshell 'dir "\\server::d:\"
Thanks
Hi,
The remote server needs to have a share exposed that you can use to get a
directory listing. The syntax would be:
exec master.dbo.xp_cmdshell 'dir \\myserver\d$'
If the path contains blanks then you need to quote the parameter with
double-quotes:
exec master.dbo.xp_cmdshell 'dir "\\myserver\c$\Program Files"'
RLF
"guest5" <guest5@.discussions.microsoft.com> wrote in message
news:C2CC72B2-F903-423A-A499-36E639532789@.microsoft.com...
> Hi
> Trying to work on a script which is able to list files on a remote server
> and its drive but unsure of the syntax. Can anyone advise as below doesnt
> work.
> xp_cmdshell 'dir "\\server::d:\"
>
> Thanks
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment