473,856 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Anyone know how to get a directory listing...

....on a remote machine?

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

Thanks,
Michael C

"Michael C" <mi*******@opto nline.net> wrote in message
news:U9******** **********@news 4.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*********@di scussions.micro soft.com> wrote in message
news:73******** *************** ***********@mic rosoft.com...
Didn't you try this?
Directory.GetFi les("\\\\a822us s\\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*******@opto nline.net> wrote in message
news:Iq******** *************@n ews4.srv.hcvlny .cv.net...
"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*********@di scussions.micro soft.com> wrote in message
news:73******** *************** ***********@mic rosoft.com...
Didn't you try this?
Directory.GetFi les("\\\\a822us s\\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*******@opto nline.net> wrote in message
news:Iq******** *************@n ews4.srv.hcvlny .cv.net...
"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*********@di scussions.micro soft.com> wrote in message
news:73******** *************** ***********@mic rosoft.com...
Didn't you try this?
Directory.GetFi les("\\\\a822us s\\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*******@hotm ail.nospam.com> wrote in message
news:3JJyc.8960 6$Ly.74701@attb i_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*******@opto nline.net> wrote in message
news:Iq******** *************@n ews4.srv.hcvlny .cv.net...
"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*********@di scussions.micro soft.com> wrote in message
news:73******** *************** ***********@mic rosoft.com...
Didn't you try this?
Directory.GetFi les("\\\\a822us s\\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
3321
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 = os.listdir(directory)
1
1452
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
3379
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 returned to my client in html. To get the directory listing from this I would need to do some intersting parsing. ftp is not enabled and so I can't do an "ls" through some ftp client. Is there some way in C# to get a directory listing using...
8
11071
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) index.html site/pagefile/
8
6959
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 thus opens index.htm, I want that file to show a listing of all files in the directory with hyperlinks to them. Thanks for the help, Doug
7
5504
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 enumerate through that array to get my listing. However I am trying to set my application up as a service. And now (after calling methods in a thread using the OnStart() method) it says the directory does not exist (I verified this with a...
4
3254
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 variable set to this: --- $dir = getcwd() . "\\" . $nav; --- but for some reason the script does not actually display the contents of the directory if you change from the directory the script is located in. Here is my code if someone is willing...
2
2543
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 put in a username and password when I go to the web address in internet explorer. Once I put in the correct username and password, it shows the directory listing.
1
5679
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? I've already tested my code for connecting but how do I list whats in the directory. The purpose is to compare the list to the filenames in my database.
0
9921
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9765
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11065
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10795
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7934
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7098
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5763
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4177
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.