469,915 Members | 2,697 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,915 developers. It's quick & easy.

Anyone know how to get a directory listing...

....on a remote machine?

Thanks,
Michael C.
Nov 16 '05 #1
5 2293
It looks like WNetEnumResource might do the trick. Anyone know of any good
examples of using WNetEnumResource in C#?

Thanks,
Michael C

"Michael C" <mi*******@optonline.net> wrote in message
news:U9******************@news4.srv.hcvlny.cv.net. ..
...on a remote machine?

Thanks,
Michael C.

Nov 16 '05 #2
"a822uss" is a UNC server name, right? And "trng" is a share? That won't
work. What I need would be more like this:

\\\\a822uss\\C: or \\\\a822uss\\D:

Microsoft does it in SQL Server Enterprise Manager when you open up the
ATTACH DATABASE dialog window; I just want to do that. A directory listing
on a remote machine without having to create a share on every single hard
drive on every single computer in every single city on three different
continents.

Anyone know how Microsoft does it?

Thanks,
Michael C

"Rakesh Rajan" <Ra*********@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Didn't you try this?
Directory.GetFiles("\\\\a822uss\\trng")

--
Rakesh Rajan
"Michael C" wrote:
....on a remote machine?

Thanks,
Michael C.

Nov 16 '05 #3
Just had one of those moments. Of course Microsoft does this through
extended stored procedures on the SQL Server itself... circumventing all
the issues that crop up trying to do it via the Win32 API, MFC, or any other
way for that matter...

Thanks,
Michael C

"Michael C" <mi*******@optonline.net> wrote in message
news:Iq*********************@news4.srv.hcvlny.cv.n et...
"a822uss" is a UNC server name, right? And "trng" is a share? That won't
work. What I need would be more like this:

\\\\a822uss\\C: or \\\\a822uss\\D:

Microsoft does it in SQL Server Enterprise Manager when you open up the
ATTACH DATABASE dialog window; I just want to do that. A directory listing on a remote machine without having to create a share on every single hard
drive on every single computer in every single city on three different
continents.

Anyone know how Microsoft does it?

Thanks,
Michael C

"Rakesh Rajan" <Ra*********@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Didn't you try this?
Directory.GetFiles("\\\\a822uss\\trng")

--
Rakesh Rajan
"Michael C" wrote:
....on a remote machine?

Thanks,
Michael C.


Nov 16 '05 #4
Unless I'm mistaken, Microsoft's attach database dialog window only shows
you the directory tree on the (remote) machine where SQL Server is running.
It doesn't work for "every hard drive on every single computer in every
single city on three different continents" either. They play by the same
rules that you do.

So, if you put a web service on each machine that you need to see the drive
contents on, and passed in parameters to get the drive contents, you should
be able to do this without that much effort too.

--- N

"Michael C" <mi*******@optonline.net> wrote in message
news:Iq*********************@news4.srv.hcvlny.cv.n et...
"a822uss" is a UNC server name, right? And "trng" is a share? That won't
work. What I need would be more like this:

\\\\a822uss\\C: or \\\\a822uss\\D:

Microsoft does it in SQL Server Enterprise Manager when you open up the
ATTACH DATABASE dialog window; I just want to do that. A directory listing on a remote machine without having to create a share on every single hard
drive on every single computer in every single city on three different
continents.

Anyone know how Microsoft does it?

Thanks,
Michael C

"Rakesh Rajan" <Ra*********@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Didn't you try this?
Directory.GetFiles("\\\\a822uss\\trng")

--
Rakesh Rajan
"Michael C" wrote:
....on a remote machine?

Thanks,
Michael C.


Nov 16 '05 #5
Through Enterprise Manager you can add SQL Servers to your SQL Server Groups
in every single SQL Server in your enterprise, "in every single city on
three different continents" if you have SQL Servers there. Additionally,
the Attach Database dialog lists the directory tree on the remote computer
where the SQL Server you have chosen is running; and all this without
installing additional web services, UNC path shares or any other
modifications to the remote machine!

If you have 100 SQL Servers, in 50 different cities, on three different
continents, you are going to have a lot of fun installing and managing a web
server on every single machine (in addition to administering SQL Server),
no? UNC path shares for the root directory of every hard drive installed on
all these machines present an equally nightmarish option.

Microsoft's "rules" appear to involve utilizing the undocumented extended
stored procedure xp_subdir to make their solution work. I doubt the
developers at MS had to search for hours on other people's websites to find
out about the xp_subdir extended stored procedure to make their solution
work. Try searching for xp_subdir on the MS website: Nothing. In the KB:
Nothing. In MSDN: Nothing. I don't see how that's really "playing by the
same rules that I do" since you bring it up, since MS seems to have some
inside information that I have to get through the back-channels of other
people's websites.

Thanks for the web service idea though; installing it on all my SQL Servers,
managing and securing this modification in addition to SQL Server admin is
not an option though.

Michael C.

"Nick Malik" <ni*******@hotmail.nospam.com> wrote in message
news:3JJyc.89606$Ly.74701@attbi_s01...
Unless I'm mistaken, Microsoft's attach database dialog window only shows
you the directory tree on the (remote) machine where SQL Server is running. It doesn't work for "every hard drive on every single computer in every
single city on three different continents" either. They play by the same
rules that you do.

So, if you put a web service on each machine that you need to see the drive contents on, and passed in parameters to get the drive contents, you should be able to do this without that much effort too.

--- N

"Michael C" <mi*******@optonline.net> wrote in message
news:Iq*********************@news4.srv.hcvlny.cv.n et...
"a822uss" is a UNC server name, right? And "trng" is a share? That won't work. What I need would be more like this:

\\\\a822uss\\C: or \\\\a822uss\\D:

Microsoft does it in SQL Server Enterprise Manager when you open up the
ATTACH DATABASE dialog window; I just want to do that. A directory

listing
on a remote machine without having to create a share on every single hard drive on every single computer in every single city on three different
continents.

Anyone know how Microsoft does it?

Thanks,
Michael C

"Rakesh Rajan" <Ra*********@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
Didn't you try this?
Directory.GetFiles("\\\\a822uss\\trng")

--
Rakesh Rajan
"Michael C" wrote:

> ....on a remote machine?
>
> Thanks,
> Michael C.
>
>
>



Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by SU News Server | last post: by
2 posts views Thread by Tom | last post: by
8 posts views Thread by gil | last post: by
8 posts views Thread by dougawells | last post: by
4 posts views Thread by techusky | last post: by
2 posts views Thread by marcusadeleon | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.