Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Enumerate IIS Virtual Directories

How do I enumerate IIS Virtual Directories?

I find in Windows XP Professional, they are stored in registry under HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesW3SVCParametersVirtual Roots

Is this same for Windows 2000 and Windows 2003?


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Virtual Directories
How do you setup a virtual directory on a IIS machine programmatically?

How To Make Virtual Cdrom Like Virtual Drive ?
how to make virtual cdrom like virtual drive ?

Find Files In Directories And Sub-directories
How find all mp3 files in all directories and sub-directories

Moving Directories / Sub Directories
Forgive me for asking what is probably a basic question, but I'm by no means a real programmer!

I want to move a dirctory and all its subdirectries / files from one location on the E: drive to a location on the C: drive using VB5.

Is there a quick and simple way of doing this?



Enumerate All DSN
What API function can i use to enumerate all the DSN of the computer ??

Enumerate Folder Name
I would like to enumerate the folder name that are in a folder and the name would be put in a textbox ( Not a Dirlistbox )

Thanx in advance.

Enumerate Computers (+IP's)
how can you enumerate the computers connected to the home network?

Enumerate Files On A FTP!
Ok I'm using Wininet to download files and make stuff like this and I found a code that show all the file on a FTP (From Phinds) but it have no comments so I'm getting lost...

I would just like to show the list in a textbox or a label but him it was in a sample node so I'm really lost...

I thing the function is in this part of the code but I just want to know it's which function, thanx in advance

Dim bRet As Boolean
Dim strItemName As String

EnumItemAttributeBag.Add pData.dwFileAttributes
strItemName = Left(pData.cFileName, InStr(1, pData.cFileName, String(1, 0), vbBinaryCompare) - 1)
EnumItemNameBag.Add strItemName
pData.cFileName = String(MAX_PATH, 0)
bRet = InternetFindNextFile(hFind, pData)

If Not bRet Then
dError = Err.LastDllError
Exit Do
InternetCloseHandle (hFind)
Exit Sub
End If
EnumItemAttributeBag.Add pData.dwFileAttributes
strItemName = Left(pData.cFileName, InStr(1, pData.cFileName, String(1, 0), vbBinaryCompare) - 1)
EnumItemNameBag.Add strItemName
End If

Thanx another time for all the help that you bring me on this forum

Enumerate The Key Of Collection, Not Value
I have an Vb6 client, that store key-value pair in collection:

Private Sub Command2_Click()
Dim colStates As New Collection

colStates.Add Item:="123-Connecticut", Key:="Connecticut"
colStates.Add Item:="523-Delaware", Key:="Delaware"
colStates.Add Item:="12-Georgia", Key:="Georgia"
colStates.Add Item:="311-Maryland", Key:="Maryland"
colStates.Add Item:="23-Massachusetts", Key:="Massachusetts"
colStates.Add Item:="11-New Hampshire", Key:="New Hampshire"
colStates.Add Item:="43-New Jersey", Key:="New Jersey"
colStates.Add Item:="410-New York", Key:="New York"
colStates.Add Item:="56-North Carolina", Key:="North Carolina"
colStates.Add Item:="1012-Pennsylvania", Key:="Pennsylvania"
colStates.Add Item:="22-Rhode Island", Key:="Rhode Island"
colStates.Add Item:="12-South Carolina", Key:="South Carolina"
colStates.Add Item:="83-Virginia", Key:="Virginia"

If Not colStates("Virginia1") Is Nothing Then
MsgBox colStates("Virginia1")
End If
End Sub
If the key is not valid, I will hit:

Run-time error '5':
Invalid procedure call or argument
how to enumerate the key of a collection?

Enumerate Functions Within DLL
Is it possible to get all of the functions that are contained within a specified dll?

Enumerate DLL Functions?
I've always just copied and pasted the declarations, but is there a way to list the subs and functions compiled into a given dll (not a common one that comes with windows)?


Enumerate A List Box
hello, i want to Enumerate all values(items) in a list box, possible to do this ?i have seen a lot of Enumeration code examples , but non of them can actually Enumerat a listbox(only the name of listbox.)


Enumerate Connections
hi can somebody tell me what API enumerate all the computer connected to
a network. I found one "Netserverenum" but it just work in winXP ME 2000 and NT. but I need to use it on win98. or a way I can add this API to win 98.

thanks for u help:-)

How To Enumerate A Process?
How are you gentlemen?

I was searching for code to enum a process and found the following

Vb Code:
1.      Option Explicit   2.          3.      Private Type PROCESSENTRY32   4.        dwSize As Long   5.        cntUsage As Long   6.        th32ProcessID As Long   7.        th32DefaultHeapID As Long   8.        th32ModuleID As Long   9.        cntThreads As Long  10.        th32ParentProcessID As Long  11.        pcPriClassBase As Long  12.        dwFlags As Long  13.        szExeFile As String * 260  14.      End Type  15.         16.      Private Type OSVERSIONINFO  17.        dwOSVersionInfoSize As Long  18.        dwMajorVersion As Long  19.        dwMinorVersion As Long  20.        dwBuildNumber As Long  21.        dwPlatformId As Long  22.        szCSDVersion As String * 128  23.      End Type  24.         25.      Private Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long  26.      Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long  27.      Private Declare Function CloseHandle Lib "Kernel32.dll" (ByVal Handle As Long) As Long  28.      Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long  29.      Private Declare Function EnumProcesses Lib "psapi.dll" (ByRef lpidProcess As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long  30.      Private Declare Function GetModuleFileNameExA Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, ByVal ModuleName As String, ByVal nSize As Long) As Long  31.      Private Declare Function EnumProcessModules Lib "psapi.dll" (ByVal hProcess As Long, ByRef lphModule As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long  32.      Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long  33.      Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long  34.      Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long  35.         36.      Private Const PROCESS_TERMINATE = &H1  37.      Private Const VER_PLATFORM_WIN32_WINDOWS = 1  38.      Private Const PROCESS_QUERY_INFORMATION = 1024  39.      Private Const PROCESS_VM_READ = 16  40.      Private Const TH32CS_SNAPPROCESS = &H2  41.         42.      Private Function CheckVersion() As Long  43.        Dim tOS As OSVERSIONINFO  44.        tOS.dwOSVersionInfoSize = Len(tOS)  45.        Call GetVersionEx(tOS)  46.        CheckVersion = tOS.dwPlatformId  47.      End Function  48.         49.      Public Function GetEXEProcessID(ByVal sEXE As String) As Long  50.        Dim aPID() As Long  51.        Dim lProcesses As Long  52.        Dim lProcess As Long  53.        Dim lModule As Long  54.        Dim sName As String  55.        Dim iIndex As Integer  56.        Dim bCopied As Long  57.        Dim lSnapShot As Long  58.        Dim tPE As PROCESSENTRY32  59.        Dim bDone As Boolean  60.         61.        If CheckVersion() = VER_PLATFORM_WIN32_WINDOWS Then  62.          'Windows 9x  63.          'Create a SnapShot of the Currently Running Processes  64.          lSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)  65.          If lSnapShot < 0 Then Exit Function  66.          tPE.dwSize = Len(tPE)  67.          'Buffer the First Processes Info..  68.          bCopied = Process32First(lSnapShot, tPE)  69.          Do While bCopied  70.            'While there are Processes List them..  71.            sName = Left$(tPE.szExeFile, InStr(tPE.szExeFile, Chr(0)) - 1)  72.            sName = Mid(sName, InStrRev(sName, "") + 1)  73.            If InStr(sName, Chr(0)) Then  74.              sName = Left(sName, InStr(sName, Chr(0)) - 1)  75.            End If  76.            bCopied = Process32Next(lSnapShot, tPE)  77.            If StrComp(sEXE, sName, vbTextCompare) = 0 Then  78.              GetEXEProcessID = tPE.th32ProcessID  79.              Exit Do  80.            End If  81.          Loop  82.           83.        Else  84.          'Windows NT  85.          'The EnumProcesses Function doesn't indicate how many Process there are,  86.          'so you need to pass a large array and trim off the empty elements  87.          'as cbNeeded will return the no. of Processes copied.  88.          ReDim aPID(255)  89.          Call EnumProcesses(aPID(0), 1024, lProcesses)  90.          lProcesses = lProcesses / 4  91.          ReDim Preserve aPID(lProcesses)  92.           93.          For iIndex = 0 To lProcesses - 1  94.            'Get the Process Handle, by Opening the Process  95.            lProcess = OpenProcess(PROCESS_QUERY_INFORMATION Or PROCESS_VM_READ, 0, aPID(iIndex))  96.            If lProcess Then  97.              'Just get the First Module, all we need is the Handle to get  98.              'the Filename..  99.              If EnumProcessModules(lProcess, lModule, 4, 0&) Then 100.                sName = Space(260) 101.                Call GetModuleFileNameExA(lProcess, lModule, sName, Len(sName)) 102.                If InStr(sName, "") > 0 Then 103.                  sName = Mid(sName, InStrRev(sName, "") + 1) 104.                End If 105.                If InStr(sName, Chr(0)) Then 106.                  sName = Left(sName, InStr(sName, Chr(0)) - 1) 107.                End If 108.                If StrComp(sEXE, sName, vbTextCompare) = 0 Then 109.                  GetEXEProcessID = aPID(iIndex) 110.                  bDone = True 111.                End If 112.              End If 113.              'Close the Process Handle 114.              CloseHandle lProcess 115.              If bDone Then Exit For 116.            End If 117.          Next 118.        End If 119.      End Function 120.        121.      Public Function TerminateEXE(ByVal sEXE As String) As Boolean 122.        Dim lPID As Long 123.        Dim lProcess As Long 124.        125.        Do 126.          lPID = GetEXEProcessID(sEXE) 127.          If lPID <> 0 Then 128.              lProcess = OpenProcess(PROCESS_TERMINATE, 0, lPID) 129.              Call TerminateProcess(lProcess, 0&) 130.              Call CloseHandle(lProcess) 131.          End If 132.        Loop Until lPID = 0 133.        TerminateEXE = True 134.      End Function

The post that went with the code was ""I use this. I originally got it off this site and modified it.
Instead of getting the exename I get the module name which is
the complete path & exe name.
strModuleName will contain the complete path."

SO my question is to use ths code, do I need to make a list view or list box after making a module called strmodulename? I don't know how to implement this code in a program i am making.

Thanks guys.

Enumerate NICs?
Is there any way, using api for instance to enumerate all NIC (network interface card) descriptions such Network names "Local Area Connection" / "Local Area Connection 2" / "VMware Network Adapter VMnet1"..."VMware Network Adapter VMnet8" / "1394 Connection" / "1394 Connection 2" etc...

ipconfig /all doesn't give me the names that i am searching for...

Does anyone ever try to do this?


Enumerate Menus
Probably a stupid question, but I can't find it... Can the menu's in a form be enumerated? There doesn't seem to be a Menus collection or something like that.

VB Code:
Dim x as MenuFor Each x In '???  


Enumerate All Folders?
How would you enumerate all the folders & subfolders, etc. on the hard drive.. like into an array. (Basically to find every single file of a certain type on the hard drive).


Enumerate IE Windows?
There was some code posted here earlier about how to grab a list of all ie windows open, and be able to interact with them as a webbrowser control.

anyone know how to do this?

Enumerate All Domains
I have found code to enumerate computers on a network, but I
need to list all domain names first. Does anyone have any code
samples or know where I can find some just for domain names?

Thanks in advance for any replies.

Enumerate Tables
Hi all,

My question is:

How can i enumerate the tables of an access file ?

i have the following code to enumerate the fields of a table:

Private Sub FILL()


For X = 0 To RS.Fields.Count - 1
Set lItem = ListView2.ListItems.Add(, , RS.Fields(X).Name, , 1)
Next X

End Sub

i wanna do something like this, but with tables of a database

thx in advance...

How To Enumerate Files?
how can I enumerate files in a specified folder?

I have found an API example but it produces errors when specifying folders which have lots of files and subfolders.

thanks in advance

What's up maggots?? I hope u are Slayerized!!!

Enumerate Windows
hi, how do i enumerate all current opened windows hwnds?

Enumerate Processes
I need to list set of exes in my program and whenever user clicks on any of the exes it should get launched. Please help me.

Thanks in advance,

Enumerate Forms

How can i enumerate all forms in a vb-project without having loaded them?
I knwo, i can enumerate all loaded forms with forms(...), but not all
are loaded.


Enumerate Tables Using ADO
how can i get the tables of an access DB using ADO


Enumerate All Folders/files
How can I enumerate all files and folders in a specific directory, (eg C:Program Files) through code and save them in an array?

Enumerate AD Group Membership
Hi I'm trying to get some VB6 / VBScript code which will enumerate the AD group membership of the current logged on user, I just want a list of the group names back.
I don't have any admin rights in the AD where the user accounts are though.
The enumgroup function in KIX does exactly what I would want, so I'm guessing it's possible?

Enumerate Properties In A WMI Object?
How can I enumerate properties of a WMI object, say Win32_OperatingSystem??

The purpose of this is to create a simple (my version of it) WMI object browser?

I have seen that most of the object have been built upon many other classes.

eg Win32_OperatingSystem has a derivation property called "Derivation_"(An array), My english is not wery good, but I guess this has someting to do with inheritance of some sorts?

It has the following values:

has it something to do with this???

Enumerate Controls On Frame
In the two following examples I have 2 problems.

1. Is that in the working sample it returns the textbox names then errors on the next statement after the last one saying type mismatch. No clue as to why.

2. The second doesn't work at all because apparently the frame object does not support this property or method. Is there a way to do the same with frames? (I.E. enumerate all controls of a type on it?)

Dim TextBox As TextBox
For Each TextBox In Form1
MsgBox TextBox.Name

'Does Not work
Dim TextBox As TextBox
For Each TextBox In Frame1
MsgBox TextBox.Name

Enumerate Applications Running On XP
How do you get the list of applications (not processes)
running on XP ?

How To Enumerate Remote Systems On The LAN?
I've been searching for a way to list all the machines on a LAN. I want to have this in a module so I can use it in other projects if the need arrises.

Any ideas?

Thanks for any input!

Enumerate Owned Windows
is there a direct way to do that?

the best thing I can think of is using EnumThreadWindows and checking the owner of each window...

Enumerate Network Machines
How would I get the list of the computers on my network? Would I use an API or am I in the wrong forum?

Enumerate Hardware Devices
Anyone know how to Enumerate the existing hardware devices, ie those that exist in the Device Manager either PNP or nonPNP.

I've been trying to do this using SetupDiGetClassDevs() etc which I can get to work OK in c++(although I'm not c++ orientated!!) but unable to do this in VB. I don't know if I'm declaring everything correctly??
The I need to iterate through each device and ensure it actually does exist on the PCIbus --- forgot to mention I'm only really interested in cards on the PCIbus...


Enumerate Existing Drives
Hello guys!

I would like to know how can I get the letter of all drives existing in a computer and how can I distinguish hard drives from cd-roms, etc...
Thank you.

Enumerate Vista Users
I have successfully managed to enumerate the users on an XP PC in VB6 but the code does not work in Vista.

Does anyone have an idea where Vista differs and if this is possible?

I do have admin rights on the Vista box

Enumerate Supported Resolutions!
Is this possible? I need to enumerate the whole list of supported resolutions, someone please help.

Enumerate Active Applications
dear all,

i'm searching all the way also in psc and such to find the simplest code ever to enumerate the active applications just like in the windows' Task Manager [Applications TAB] (i.e. not the full processes, classes, sub-classes, etc, just the windows).

anyone has this snippet?...



Enumerate All Programs Running
I know the following functions:

VB Code:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVallpClassName As Long, ByVal lpWindowName As Long) As Long  Public Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long  Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long  Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long  Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long  Public Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long  Public Declare Function GetDesktopWindow Lib "user32" () As Long  Public Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long  Public Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long  Public Declare Function GetCurrentProcess Lib "kernel32" () As Long  Public Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long

How can I use them to enumerate all programs running (hidden or not)

Enumerate Icons In The SysTray
I know how to add an icon to the system tray; my question is how would I enumerate all of the icons that are there? And, how would I be able to send click events onto those tray icons (so I can get the popup menus or whatever).

Enumerate Class Properties
Is there a way to enumerate class properties or do I have to do it the hard way. What I want to do is this:

VB Code:
Sub PrintClassProperties(MyClass as c_MyClass) Printer.Print vbNullString for each Property in MyClass   Printer.Print Property.Name & ": " & Property.ValueNext Property Printer.EndDoc End Sub

Enumerate Through Control Properties?
Is there a way to enumerate through all the properties of a given control in VB?

I tried the EnumPropsEx API but it only enumerates through properties that I have added using SetProp.

What I'm talking about is the "intrinsic" properties that are assigned to each control by VB.

Any help would be appreciated..


Enumerate Font Sizes
Following code returns duplicate font sizes in a combobox
Any suggestions or a better way.


'Load Font Sizes for Active Font
'VB Substitutes the Closest Available Size
'Note: To get TrueType Fonts < 8 you must
' - Set the Font Size
' - Set the Font Name
' - Reset the Font Size

With Font
For i = 1 To 24 Step 2
.Size = i
' Font.Name = mstrFCFont
' Font.Size = i
cboFCFontSize.AddItem .Size

'Make sure Font Size is set to previous selection
.Size = miFCFontSize

End With

Enumerate Child Windows
is there a way to enumerate child windows in VBA. I have a method to do it in VB6 but it appears that VBA (Access) does not support the AddressOf operator. I have a login window for a program and have to search for the text entry boxes. They are not in sequential order and both have edit for the class

Enumerate Profiles On Workstation
This may seem somewhat trivial ... but it's Friday and my brain isn't functioning properly.

I need to be able to enumerate the profiles on a workstation (Win98/NT/2K) along with the SID that they are associated with. (Much like the profile enumeration when you right-click My Computer and select the "User Profiles" tab.)

Anyone know of a snippet of code that will address this?



Need To Enumerate All Info In Html Tag
so i've got a tag like so:

<img src = "red.gif" border=1 onClick="if (led.src='red.gif') { led.src='green.gif'; } else { led.src='red.gif'; }" name="led" id="led"

BTW, chances are that script doesn't work. That's irrelevant, i'm just trying to demonstrate lots of attributes in a tag. Besides all that, i put in a crlf before the last > and varied spaces between attributes and equal signs.

Anyway, how can I parse through to get the various properties. The only one that's really important is Name, however, I woould like to be able to get all the attributes. this will let me create a property window for html tags kind of like the vb property window.

Thanks in advance.

Enumerate Control Properties
How do I enumerate the properties of a control?
I want to get all the property names into a listbox.

How Do You Enumerate System DSNs?
My program has the need to determine all of the registered DSNs for the system (this is set through the ODBC icon in the control panel). Anyone know how to do this (assuming it can even be done).


Enumerate Collection In RichTextBox
How do I print the items in my collection in a RichTextBox. If I try to show the items in my collection in debug.print, all the items in my collection show. So I know I have the enumeration part set up correctly. If I try to use the same process in the RichTextBox, it loops through the collection, but the items write on top of each other so the only item showing is the last item in the collection. I have the MultiLine option set to true.

[Edited by tspeiran on 03-20-2000 at 07:06 PM]

Copyright 2005-08, All rights reserved