473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Anyone know how to get a directory listing...

....on a remote machine?

Thanks,
Michael C.
Nov 16 '05 #1
5 2468
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: SU News Server | last post by:
I've struggled with this for quite a while and I'm am just not sure what is going on. I have the following code import os def buildList( directory='/Users/mkonrad' ) dirs = listing =...
1
by: pointBoarder | last post by:
I'd like to be able to create a table listing all the files in a certain directory... Anyone know how to go about this or where I could look for more information? Thanks for the hand :] Derek
2
by: Tom | last post by:
I need to get a directory listing through http. If I put the directory path in the browser address bar such as http://somewebpage.com/subdir I get the listing of the directory. Of course this is...
8
by: gil | last post by:
Is it possible to prevent a browser from listing the entire contents of a folder? The site, is hosted on my ISP with the following layout- site/ "user name from ISP" pagefile (dir)...
8
by: dougawells | last post by:
Hi - I'm hoping for help with the auto-generation of a hyperlinked listing of all files in a directory. The server I use does not auto-generate this. So, when someone comes to this directory and...
7
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
4
by: techusky | last post by:
I have a *very* simple script written that displays the directory listing of the current working directory, but I am having some difficulty when I try to change folders. Basically, I have my $dir...
2
by: marcusadeleon | last post by:
Hi, I was wondering how to open up a web directory to get a file listing. The directory I want to open allows directory listings, but has a directory password. Meaning it gives me a prompt to...
1
by: Steve | last post by:
My site is hosted on a Godaddy reseller site. Godaddy only allows the use of Curl to access remote sites. What is the method for listing a directory after connecting to the site with Curl? ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.