Monday, February 20, 2012

Please Help!How to get directories list for remote machine?

Hello,
We are developing appl. Backup/Restore database using SQLServerAgent.
In my appl. I want to do the same as in the SQL Enterprise(2000),
when I select server for backup, Enterprise display brower list (hard
disks>dir...) for selected machine.
How I can get the browser(Hards>dirs) for selected machine?
Thanks in advance,
Pola
Pola
How does your question relate to SQL Server? Perhaps some controls provided
with .NET technology may help you.
"Pola" <Pola@.discussions.microsoft.com> wrote in message
news:05C7D6B8-E7A0-4545-90E2-4B4B36C87663@.microsoft.com...
> Hello,
> We are developing appl. Backup/Restore database using SQLServerAgent.
> In my appl. I want to do the same as in the SQL Enterprise(2000),
> when I select server for backup, Enterprise display brower list (hard
> disks>dir...) for selected machine.
> How I can get the browser(Hards>dirs) for selected machine?
> Thanks in advance,
> Pola
>
|||Rather than using SQL Server, I suggest you consider WMI queries to
enumerate remote resources. C# example:
//System.Management rreference required
ObjectQuery localDiskQuery =
new ObjectQuery("SELECT Name FROM Win32_LogicalDisk WHERE DriveType =
3");
using (ManagementObjectSearcher searcher =
new ManagementObjectSearcher(localDiskQuery))
{
searcher.Scope =
new ManagementScope(string.Format(@."//{0}/root/cimv2",
ServerName));
foreach (ManagementObject logicalDisk in searcher.Get())
{
Console.WriteLine(WriteLine(logicalDisk["Name"].ToString());
}
}
Hope this helps.
Dan Guzman
SQL Server MVP
"Pola" <Pola@.discussions.microsoft.com> wrote in message
news:05C7D6B8-E7A0-4545-90E2-4B4B36C87663@.microsoft.com...
> Hello,
> We are developing appl. Backup/Restore database using SQLServerAgent.
> In my appl. I want to do the same as in the SQL Enterprise(2000),
> when I select server for backup, Enterprise display brower list (hard
> disks>dir...) for selected machine.
> How I can get the browser(Hards>dirs) for selected machine?
> Thanks in advance,
> Pola
>

No comments:

Post a Comment