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

Error When Finding Directory

I have a peice of code that will save the directory path if you select
a button. Then when I load the directory back into a navigation
tree i get an error

If Len(Dir$(drawdir, vbDirectory)) > 0 Then
frmGetfiles.dirDirectory.Path = drawdir
frmGetfiles.dirDirectory.Path = "c:"
End If
It will not make it past the first line. I will purposely break the
path so that after I save it, when I try and load the path it does
not exist. So in theory it should be "c:" right?

Any suggestions or help would be greatly appreciated.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Finding Files In A Directory Without Name Of File (finding All Files Labeled .mp3)
Ok, my problem is this: I am developing a media player and, for the playlist, some of the users want to be able to add an entire directory of files to it.

I have been trying to use the: SearchPath Lib "kernel32" function but have yet to be able to have it find all files labeled '.MP3' '.WAV' or '.MPG'

Any ideas?

Finding Directory
hi all, i have this prob with locating the winmx directory sometimes. its default directory is program files but inevitably its not the same on all comps. how would i get this code to work if winmx could be located anywhere?

Kill "C:Program FilesWinMXOLEDLG.DLL"

Finding The Directory
How would I get the location of Game.exe out of this string? (Just C:Program FilesSoftware)
C:Program FilesSoftwareGame.exe

Finding All .txt In Directory
I can quite easily make code that finds all the files in a folder.

VB Code:
Private Sub Command1_Click()Dim a As StringDim b As Stringb = "start"a = "nothing yet"b = Dir("C:")Do While a <> b    On Error Resume Next    a = b    b = Dir    List1.AddItem bLoopList1.RemoveItem (List1.ListCount - 1)List1.RemoveItem (List1.ListCount - 1)End Sub

I suppose I could check the strings and with .txt before I add them to the list, but I was wonderign iof there is a way of using DIR to only get .txt files. or any other extension for that matter.

Finding The Current Directory
I need to find the directory that my application was executed from and save it to a string. How would I do this?

Finding The System Directory
Is there any way to get the system directory from any computer? I know there's the Environ thing, but that only works on 2k/xp computers, and it's apparently not standard. this:

Mid(Environ(16), InStr(1, Environ(16), "=") + 1, InStr(1, Environ(16), ";") - InStr(1, Environ(16), "=") - 1)
showed the system directory on my comp (win2k), but on an XP comp, it got an error because it returned "processor_level=6", instead of a list of directories.
I need a way of getting the system directory on Windows 98 (and SE), 2000, and XP.

Finding Out The Program's Directory
My program tries to load a .txt file when it loads, but it doesn't always look in the right directory. The txt it expected to be in the same directory as the exe. So, if I just run the program, it loads fine. However, if I open a file from a different directory with my program, it no longer looks in the right place. So, how can I identify the directory from which the program is running?


Finding Parts Of Name In Directory
Hey guys, currently im making a program and I need part of it to find names of multiple files based on user input, the file names for examples are like 1pstandaimsg44.baf, the user will input sg44 and I need it to find sg44 in that filename and many others in a folder they specify and once its found it copies them, renames them to another user input and moves them to another folder, im stumped at the point of this code which I found on the net and modified but doesnt really help me at all.

Private Sub Command2_Click()

Dim fso As FileSystemObject
Dim sPathFile As String

Set fso = New FileSystemObject

sPathFile = "c:animations" + animbasetb.Text + ".baf"

With fso
If .FileExists(sPathFile) Then
MsgBox "There is your FILE in This Directory: " & sPathFile
MsgBox "There aint * * * *"
End If
End With

End Sub

Anyone help, give sample code, thoughts ideas anything

Finding Windows Directory
is there an api call that allows you to find where the windows directory is located?
as if, when called, it will return a string that says "c:windows" or something with a different drive, wherever the directory is

Finding A Path From The Directory...
Hi all,

I need my proggy to find out a directory that is being watched by Adobe's Distiller Server by searching the registry.

I'm pretty sure I need to use RegQueryValueEx from the Windows API. However the pathname seems to come up as a folder in the registry and not a key?

HKEY_LOCAL_MACHINESOFTWAREAdobeAcrobat Distiller4.0WatchedFoldersC:|access

Can anyone help me figure out how to have my VB program grab that directory?

Finding A File In A Directory

How can I know if a file already exists in a directory?

Finding Windows Directory

is there any simple way to find out the directory windows is installed to?

Finding Application Directory
I have used chdir in my application which works fine for me, but if a user installs my app. to a different directory how can my app. find out where this is during execution?
Is it possible to extract this information from the 'Start in:' as seen in the 'shortcut' properties of the app?
I have tried using 'Path' instead of chdir but cannot get it to work properly.

Thanks for any help,

Finding The CD ROM Root Directory

Does anyone know how to find the CD ROM root directory through VB?

And return it as a string?


Kind regards,
Darren Logan BSc(Hons)
Development Engineer

Finding Directory Size?
How would I find the size of a directoy?

Thankz, Drew Love Your Stuff

Finding A File In A Directory
Hi all

Can anybody give me an idea for Finding a file in a particular directory(incliding wildcards). I tried using FSO but it is not working with wildcards.

Thanks in advance

[VB] Finding Files In A Known Directory
Is there a way I can find all of the files with a certain extension in a known directory and save them in a string array without referencing the a filesystemobject..? using api calls would be great..

what I want to store is something like this

for i = 0 to numberOfFilesInDirectory
filenamearray(i) = [fileName if file has extension txt]
next i

I want my code to be as small as possible.

any help would be great

VB6 Finding The Newest Folder In A Directory
i basically need to look in a directory, a folder is created daily in this particular directory, and i need to get the name of the newest folder created in the directory that i am looking in.


C:ftpprogramsapps i need to look in this directory and get the name of the news folder created in the subdirectory apps.

Finding The Current Directory A Program Is In
Whats the command for it? Isn't it something like "curdir" or something?

Finding A Valid Directory - Resolved
Here is my issue.

Two things

1. I am trying to find out if a directory is valid. The user is entering a directory. If the directory does not exist, I don't want to allow the acceptance of the directory. How do I effective test for the existance of a directory?

2. The waving smiley face is annoying. Sorry.

Thanks for your help

Finding Location Of Windows/system32 Directory
I'm almost embarassed to post this, since it seems like such a simple question, but I've been searching around and I don't see a simple way to do this. I'm probably just using the wrong search terms. But anyway, I want to be able to find the windows/system32 directory without scanning the drives, etc. Some people may not have their windows on C:, some may not have even called it windows. I don't know - but I want an easy way to find the system32 directory.

Also, anyone know if Windows 95 has a system32 directory? Or does it just have a system directory? I want to make this compatible for Windows 95 people, but I don't even know anyone with that installed.



Finding Path To System32 Directory On Users Pc
Hi there

I am writing an automatic update module to update my software on the user's pc.

I will be comparing the versions of the components they have installed with the updated components, to see if they need the updates. For this I need the file path to the components.

The components will either be stored in the application directory or the system32 directory. For the application directory I can use app.path to find the path, but how do I find the path to their system32 directory?

Many thanks


Finding The Highest Number In A Directory... STILL UNRESOLVED
We are currently building a package which places each estimate number into a file like this...


I have programmed a listview to read-in all the files in the estimates directory... but you have to give it a number from at to... IE.

For Intx = 0 to 25000

The question being... how can i search the directory for the highest number of file to that number can replace the 25000 in the example. The trouble is, when the user enters a number 25001... it won't find it.

I can't set the number to 10000000 before anyone it would take weeks to open the program.

Any help would be much appeciated.



Finding Location Of Windows/system32 Directory
I'm almost embarassed to post this, since it seems like such a simple question, but I've been searching around and I don't see a simple way to do this. I'm probably just using the wrong search terms. But anyway, I want to be able to find the windows/system32 directory without scanning the drives, etc. Some people may not have their windows on C:, some may not have even called it windows. I don't know - but I want an easy way to find the system32 directory.

Also, anyone know if Windows 95 has a system32 directory? Or does it just have a system directory? I want to make this compatible for Windows 95 people, but I don't even know anyone with that installed.



Creating Users In Active Directory - Finding References
Which references are required?

I think, I found 2 parts of it:

- Active DS Type Libary
- Windows Script Host Object Model (Ver 1.0)

Are any components required?


The following code snippet creates a user with only the essential properties explicitly set (cn, sAMAccountType) and displays the properties of the new user:


sComputer = InputBox("This creates a user in a Windows 2000 domain." & vbCrLf & vbCrLf & "Specify the domain name or the name of a domain controller in the domain. (for example, ):")
sContainer = InputBox("Specify the name of the container where you want to create the user : (for example, CN=Users,DC=MyDomain,DC=Development,DC=microsoft,DC=com")
sUser = InputBox("Specify the name of the user to create: (for example, Bob )")

If sUser = "" Then
MsgBox "No user name was specified. You must specify a user name."
Exit Sub
End If

If sComputer = "" Then
On Error GoTo 0
MsgBox "No computer or domain was specified. Script will use the current user's domain " & WshNetwork.UserDomain & "."
Exit Sub
sPrefix = "LDAP://" & sComputer & "/"
End If

If sContainer = "" Then
WScript.Echo "No container was specified. Script will use the Users container in the specified domain."
Set IADsRootDSE = GetObject(sPrefix & "rootDSE")
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on GetObject method"
End If
sDomain = IADsRootDSE.Get("defaultNamingContext")
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on Get method"
End If
sContainerDN = "cn=Users," + sDomain
sContainerDN = sContainer
End If

'Bind to the container
Set cont = GetObject(sPrefix & sContainerDN)
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on GetObject method"
End If
'Add the user
Set user = cont.Create("user", "cn=" & sUser)
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on Create method"
End If
user.put "samAccountName", sUser
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on Put samAccountName method"
End If
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on SetInfo method"
End If
strText = "The user " & sUser & " was successfully added."
strText = strText & vbCrLf & "The user has the following properties:"
'Refresh the property cache
'zz Count = user.PropertyCount
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on PropertyCount method"
End If
strText = strText & "Number of properties: " & Count

For cprop = 1 To Count
Set v = user.Next()
If IsNull(v) Then
Exit For
End If
strText = strText & vbCrLf & cprop & ") " & v.Name & " (" & v.ADsType & ") "
show_items strText, sComputer
strText = "User operational attributes"
user.GetInfoEx Array("canonicalName", "allowedAttributes", "allowedAttributesEffective"), 0
strText = strText & vbCrLf & "Canonical Name:" & user.Get("canonicalName")
If (Err.Number <> 0) Then
BailOnFailure Err.Number, "on Get method"
End If
show_items strText, sComputer

cattr = 0
strText = "Attributes Allowed"
attr = user.GetEx("allowedAttributes")
For Each attrval In attr
cattr = cattr + 1
strText = strText & vbCrLf & cattr
show_items strText, sComputer

cattr = 0
strText = "Attributes Effective"
attr = user.GetEx("allowedAttributesEffective")
For Each attrval In attr
cattr = cattr + 1
strText = strText & vbCrLf & cattr
show_items strText, sComputer
'Display subroutines
Sub show_items(strText, strName)
MsgBox strText, vbInformation, "Create User on " & strName
End Sub

Sub BailOnFailure(ErrNum, ErrText) strText = "Error 0x" & Hex(ErrNum) & " " & ErrText
MsgBox strText, vbInformation, "ADSI Error"
End Sub


Any suggestions?

thx, vbzero

Finding The On Error
Anybody know how to find the object of the last issued On Error .... command?

That is where is the silly thing going to go when it hits an error?

Finding Error

I have a program that I built an install set for. When I run the program interactivelly, there are no bugs. When I run the executable there are no bugs. When I install the program and run it, I get an error saying file not found. Does anyone know how I could find whats causing this error?

Thanking you in advance


Need Help Finding Error In Code Here...
The error occurs on the following line:
VB Code:
For x = 0 To File1.ListCount - 1

Here's the code:
VB Code:
Private Sub Command2_Click()'Dim stuff hereDim x As IntegerDim table As StringDim fname As StringDim strFilepath As String, strFileName As String, _strFileSize As String, strArtist As String, _strTitle As String, strAlbum As String, strTrack As String, _strFrequency As String, strBitrate As String, _strLength As String  'add the new category to the listboxlstCategories.AddItem txtcategory.Text 'Create a new table in the Database for the categoryCall ADOCreateTable 'connect to the databaseDim Cnn As ADODB.ConnectionDim SQL As StringSet Cnn = New ADODB.ConnectionCnn.Open ConnectionString:="Provider=Microsoft.Jet.OLEDB.4.0;" & _      "Data Source= c:windowssystemkamo.mdb;" 'set table = to the category addedtable = txtcategory.Text 'Loop through the filelistbox getting info on the filesFor x = 0 To File1.ListCount - 1    fname = File1.Path & "" & File1.List(x)    ReadMP3 fname, True, True    'Store the info as strings    strFilepath = fname    strFileName = File1.List(x)    strFileSize = FileLen(fname)    strArtist = GetMP3Info.Artist    strTitle = GetMP3Info.Songname    strAlbum = GetMP3Info.Album    strTrack = GetMP3Info.Track    strFrequency = GetMP3Info.Frequency    strBitrate = GetMP3Info.bitrate    strLength = GetMP3Info.Duration        'Use SQL to insert the information in the strings into the tableSQL = "INSERT into Table (Filepath,Filename,Filesize,Artist, _Title,Album,Frequency,Bitrate,Length,Track#) _VALUES ('" & strFilepath & "','" & strFileName & "', _'" & strFileSize & "','" & strArtist & "','" & strTitle & "', _'" & strAlbum & "','" & strTrack & "','" & strFrequency & "', _'" & strBitrate & "','" & strLength & "')"Cnn.Execute SQL Next  'Update the combocategory on the main formCall WriteTextFile End Sub

Error When Finding Last Column With Data
Ok this code works but it keeps giving me an error after everytime i exit the form somehow. Its runtime error 1004, application defined or object defined error and points to the LastColumnWithData line.

My msgbox is giving me the correct values everytime but when the form closes it gives an error. Not sure how to fix it so help would be very appreciated. Thanks.

Sub Get_Sub_Category_Info()
Dim ListIndexVal As Integer
Dim ListValue As Integer
Dim LastColumnWithData As Integer

ListIndexVal = Input_frm.Cat_cbo.ListIndex
ListValue = ListIndexVal + 1
LastColumnWithData = Sheets(4).Cells(ListValue, Columns.Count).End(xlToLeft).Column

MsgBox (LastColumnWithData)
End Sub

On Error Of Finding Web Page With Vb Code
I am working on a project and what i'm trying to do is use VB 6.0 to take in a part number and then display the drawing at the click of a button. The problem is that the extension could be one of two different things and the searching engine is an ftp type deal. i use internet explorers ftp engine to look the part on the server and display it. I want it to check for the one extension and if that part number isn't found, then check the next one to try for it and it that one is not found, put up a message box. This is the code that i have this far:

Private Sub Form_Load()
On Error Resume Next


StartingAddress = "" & Part & ".dwg"
StartingAddress2 = "" & Part & ".slddrw"

If Len(StartingAddress) > 0 Then
'try to navigate to the starting address
timTimer.Enabled = True
brwWebBrowser.Navigate StartingAddress
'On Error GoTo err_StartingAddress
End If

' brwWebBrowser.Navigate StartingAddress2
' On Error GoTo err_StartingAddress2

' MsgBox "File Not Found, Try Another Filename."

End Sub

i commented alot out just so i could have that small part working. If anyone has any ideas to this one or can help me it would be greatly appreciated. Thank you very much in advance.

Finding Line An Error Occured?
Is it possible to find the exact line that an error has been thrown from? I am using On Error GoTo ErrorHandler: but, if I don't have to do that, then I can change it.

The err object doesnt have a 'line' property

Finding An Object That Had An Error (Combobox)
How do I find out what control an error spawned from.

I have this code:

Private Sub SetupCrap()
On Error Goto ErrorHandler

' Note: Combo1.Style is set to DropDown List
' so it's .Text property is readonly!

' Setup items available in Combobox
Combo1.AddItem "Item1"
Combo1.AddItem "Item2"
Combo1.AddItem "Item3"
Combo1.AddItem "Item4"

Combo1.Text = "Item3" ' this works fine because it is in the list
Combo1.Text = "Item5" ' this causes error #383 because it isn't in the list

Exit Sub

Select Case Err.Number
Case 383
' Since the item I tried to select wasn't there I want to add it to the list
' The problem here is I want to make Combo1 be whatever control cause the error
Combo1.AddItem "Item5" ' add it
Combo1.ListIndex = Combo1.NewIndex ' select it
Case Else
End Select
End Sub

Ok, see how the value you assign with the .Text property has to be in the Combobox's list?

I have a lot of Comboboxes and I want to make a general error handler for case 383. I basically need to know which combobox made this error so I can then say WhateverComboBox.Additem... blah, blah.

Help Finding Undefined Variable Error
I'm cleaning up some old code that's been handled by several people, so the question I'm about to ask is probably some minor mistake that I'm just overlooking. But, I've been working on this for some time now, and just can't seem to find the error, so I apologize in advance for trivial-ness.

Here's the code I'm running.  This is to initial a class and open a form to adding items to a lookup table.

CODEOption Explicit
Dim mvarCounty As String
Dim mvarCity As String
Dim mvarDealer As String

Dim WithEvents adoPrimaryRS As Recordset
Private DoingRequery As Boolean
Public Event MoveComplete()

Public Property Let Dealer(ByVal vData As String)
     mvarDealer = vData
End Property
Public Property Get Dealer() As String
   Dealer = mvarDealer
End Property
Public Property Let City(ByVal vData As String)
     mvarCity = vData
End Property
Public Property Get City() As String
   City = mvarCity
End Property

Public Property Let County(ByVal vData As String)
     mvarCounty = vData
End Property
Public Property Get County() As String
   County = mvarCounty
End Property

Private Sub Class_Initialize()
  Dim db As Connection
  Set db = New Connection
  db.CursorLocation = adUseClient
  db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath

  Set adoPrimaryRS = New Recordset
  adoPrimaryRS.Open "SELECT DealerName, DealerCity, DealerCounty " _
                    & "FROM tb_Dealer_Info " _
                    & "ORDER BY DealerName ASC", db, adOpenStatic, adLockOptimistic
  DataMembers.Add "Primary"
End Sub

Private Sub Class_GetDataMember(DataMember As String, Data As Object)
  Select Case DataMember
  Case "Primary"
    Set Data = adoPrimaryRS
  End Select
End Sub

Directory Error #76
Someone using my program is getting the error "Directory error # 76 - invalid directory designation!"

This error occurs when using a DirListBox. It also only occurs when the machine name is
Ex. \fw.test.comdrive

if the machine name is anything else it works fine. And it shows up as a good shared network drive in Windows Explorer.
Ex. \work1drive

Any help would be greatly appreciated.

Count Files In A Directory, AND Sub Directory, - Copy A Directory...

how do u:

1) count how many files are in a directory, and its sub directory?

2) How do you copy a directory, AND count how many files out the directory has been copied?


Directory List Dir() Error
I've looked through other posts, believe I have the code for creating a list of all files in a directory correct, but cannot figure out why my code in Excel VBA gives me an error "5 invalid proceedure call" on the fname = Dir() (second to last) line. Any suggestions?

Option Explicit

Sub OpenFiles()
Application.ScreenUpdating = False
Dim fileList() As String
Dim fName As String
Dim fPath As String
Dim I As Integer
Dim DataFile As Variant

Dim fNameAndPath As Variant
Dim CopyBook As Variant

'define the directory to be searched for files
fNameAndPath = Application.GetOpenFilename _
(FileFilter:="Excel Files (*.XLS), *.XLS", _
Title:="Find Workbook")
If fNameAndPath = False Then Exit Sub
Workbooks.Open fNameAndPath, UpdateLinks:=3, ReadOnly:=False
fPath = ActiveWorkbook.Path

'build a list of the files
fName = Dir(fPath & "*.xls")

While fName <> ""
'add fname to the list
I = I + 1
ReDim Preserve fileList(1 To I)

fileList(I) = fName
'get next filename
fName = Dir()

Getting Error When Creating Directory
Hi Guys

I am getting an error when I create a folder with the path set in a variable, but when hard code the path as a string it works well. Here is why I have:

dim path as string

path = c: est est1


but if I do this it works:

MkDir "c: est est1"

Any idea why I am getting an error?The error is PATH NOT FOUND


IIS Virtual Directory Scripting: Error
I have a VB program running on .net to create virtual directory in IIS. Input
to this program is virtual directory name and path. It creates VirDir successfully.
But one problem, is always point to the toplevel directory rather than the
current newly created folder. For eg.. I give "tempvirtual" as folder name
to be created as virtual and browse the path c: emp for creating physical
directory "tempvirtual". Here I can see both physical and virtual directory
created,BUT when I open virtual directory "tempvirtual" I see all the files
and file folders under c: emp in newly created "Tempvirtual". Instead I
want this directory to be pointed to c: emp empvirtual. HOw can I do this?
Can anybody help me?


Error Copying Directory From Server To Local Pc
i got this error with my code, the sub simply going to copy a directory from the server to the local pc, the directory got copy over but it generated a error. can someone take a look at my code and let me know where i mess up or miss.


#Region "Sub_CpyImg"
Private Sub CpyImgs()
Dim y As Integer = 0
Do Until y = arlsGpYN.Count
If CInt(arlsGpYN.Item(y)) = 1 Then
Dim x As Integer = 0
Dim intGpYNFlag As Integer = CInt(arlsGpYN.Item(y))
Dim strPth As String = JbSitesDir(strJobSite)
Dim strImgsPth As String = CStr(arlsTempltGpPth.Item(intGpYNFlag))
If My.Computer.FileSystem.DirectoryExists(strImgsPth) Then
My.Computer.FileSystem.CopyDirectory(strImgsPth, strPth, False)
x += 1
End If
Catch ex As Exception
End Try
x += 1
Loop Until x = arlsTempltGpPth.Count
y += 1
End If
y += 1
End Sub
#End Region
Edit by loquin: I've moved this post from the classic VB forums to the dotNet forums...

Error:The Directory Property Cannot Be Found In The Cache
I want to collect user profile from Active Directory. User Profile like: First Name, Last Name, Address, E-mail etc.
For that reason i am using "Active DS Type Library"
Here is the code i have write:

VB Code:
Private Sub Command1_Click()    Dim dsDomain As IADsDomain    Dim dsUser As IADsUser    Set dsDomain = GetObject("WinNT://")    dsDomain.Filter = Array("User")        For Each dsUser In dsDomain        If UCase(Text1.Text) = UCase(dsUser.Name) Then            Label1.Caption = dsUser.FullName            Label2.Caption = dsUser.Department                                    Exit Sub        End If    Next    End Sub

By this code i can retrieve FullName correctly. But i can't view the others properties of user profile. It raises an error"The directory property cannot be found in the cache" How can i solve this.

Edit: Added [vbcode][/vbcode] tags for clairty. - Hack

Run-time Error: '76' Path Not Found When Creating A Directory
Hey Guys,

When I use the following code to create a folder I get this error message, Run-time error: '76' Path not found.

Dim fso As New FileSystemObject

If fso.FolderExists("C:AB") = False Then
fso.CreateFolder ("C:AB")
End If

BTW the folder "C:A" already exists before I try to create the sub-directory. Thanx.

I Need Help Finding Missing Reference?? Compile Error: "Cannot Find Project Or Librar
Hi Guys,
I have moved my project to a new stand alone PC, I installed VB6 and the service packs I use as I usuall have done in the past.

But when I try to run my project its erroring out on a form that has a web browser and toolbar.

The error I get says

Compile Error: "Cannot find project or library"

Once I click ok at the error message the reference panel opens and is wanting me to make reference to this missing file I guess??

In my project the program stops on this line

Private Sub tbToolBar_ButtonClick(ByVal Button As Button

Can anyone suggest what file VB is looking for and will it be on my VB6 Discs?

Thanks in advance to anyone who can help me here.
Regards as ever

Error When Read Active Directory: The Property Cannot Be Found In The Cache. Help!
I'm trying to get user details out of Active Directory but when it hits the line where i get the physical address
[ txtOffice.Text = userObject.Get("physicaDeliveryOfficeName") ]
it displays this error "The Directory Property cannot be found in a Cache" Can anyone tell me how to solve this. I'll be happy if you can give me a code too.


Just Move A Directory, Into An Exsisting Directory, Replacing All Files That Exsist .
Just Move a directory, into an exsisting directory, replacing all files that exsist , if i am moving the directory to, and the file already exsists there,

Just like in Windows Explorer,

How do i do this?

(urgent, Need Help) Moving File From One Directory To Another Directory Problem
i have a question regarding about the problem that stated at the title.

i need to make sure that after the flat file's data dumped into database then only the particular flat file can be move from one directory to another directory.

i failed to do it, please help

please refer to the attached below

Copy All Files In Current Directory To Temp Directory
ok heres the situation, i need to copy all the files in the app.path directory to another directory....the problem is, with the current code, i can run the app from a folder on the hdd fine, but i get an error when trying to run the app from the root directory of the cdrom....heres my code...btw apppath is a function which returns "D:" when running from the cdrom

error is invalid procedure argument or call, on the copy function

VB Code:
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long'--------    Dim fso As New FileSystemObject    Dim Folder2Copy As Folder    Set Folder2Copy = fso.GetFolder(AppPath)    If Not fso.FolderExists(TempPath & "InternetSignup") Then fso.CreateFolder TempPath & "InternetSignup"        Folder2Copy.Copy TempPath & "InternetSignup", True'--------Private Function TempPath() As String    'Function to control the TempPath API    Dim strBuffer As String    Dim lngLen As Long    lngLen = 1024    strBuffer = Space(lngLen)        If (GetTempPath(lngLen, strBuffer) > 0) Then        strBuffer = Left(strBuffer, InStr(1, strBuffer, vbNullChar) - 1)    Else        strBuffer = ""    End If        TempPath = strBuffer    End Function

EDIT: Resolved by moving all files to a subfolder on the cdrom

Directory Dialog That Returns A Directory Location Navigated To
Is there an existing control that I can use that will allow me to navigate to a directory with methods to return that directory. The ones coming with VB6 forces one to input a name and then returns the directory path and the file name which then has to be parsed off.

How To Retrieve The Current Directory And Create A Directory In It Using VB Code
I am using common dialog control to get the file name, user wants to save. Also I have a text box in which the user can enter the filename manually. Incase the user enters the filename to be saved manually, how can I validate the filename and Directory using VB. Secondly if the directory path specified by the user doesnot exist , how can i create the directory structure through VB code. Finally how can I retrieve the curr Directory path, incase user only enter the filename.
I would greatly appreciate any help in this regard. Thanks


Treeview Directory Listing With Add Directory Option
Hi there !
What i want is a treeview directory listing with an Add Directory Option which will add a directory and put it in the right place.

the code i have is this but it does not have a create directory option

Thanks !!!

Public Function vbGetBrowseDirectory(ByVal hwnd) As String


Dim r As Long
Dim pidl As Long
Dim tmpPath As String
Dim pos As Integer

bi.hOwner = hwnd
bi.pidlRoot = 0&
bi.lpszTitle = "Select the directory"

'get the folder
pidl = SHBrowseForFolder(bi)

tmpPath = Space$(512)
r = SHGetPathFromIDList(ByVal pidl, ByVal tmpPath)

If r Then
pos = InStr(tmpPath, Chr$(0))
tmpPath = Left(tmpPath, pos - 1)
vbGetBrowseDirectory = ValidateDir(tmpPath)
Else: vbGetBrowseDirectory = ""
End If

End Function

Public Function ValidateDir(tmpPath As String) As String

If Right$(tmpPath, 1) = "" Then
ValidateDir = tmpPath
Else: ValidateDir = tmpPath & ""
End If

End Function

Copyright 2005-08, All rights reserved