MajorGeeks Support Forums

Go Back   MajorGeeks Support Forums > ----------= PC, Desktop and Laptop Support =---------- > Software
Register FAQ Members List Calendar Casino Mark Forums Read

Software Software such as operating systems like Windows XP, Windows Vista, Windows 7 etc., or specific programs.


Reply
 
Thread Tools Display Modes
  #1  
Old 09-25-06, 08:31
ceal21c ceal21c is offline
Private First Class
 
Join Date: Mar 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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:\A\B") = False Then
fso.CreateFolder ("C:\A\B")
End If

BTW the folder "C:\A" already exists before I try to create the sub-directory. Thanx.
Reply With Quote
Sponsored links
  #2  
Old 09-25-06, 09:23
matt.chugg's Avatar
matt.chugg matt.chugg is offline
Major Geek
 
Join Date: Jul 2006
Location: Cornwall UK
Posts: 3,260
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Run-time error: '76' Path not found when creating a directory

Is it definatly this line that is throwing the exception ?

fso.CreateFolder ("C:\A\B")

the only way I can replicate the error is if the c:\a folder doesn't exist.

if there is no 'a' folder in c: then it will fail but if it is there is it should be fine.

I know you say the a folder is there but just try this code:

Code:
    Dim fso As New FileSystemObject
    If Not (fso.FolderExists("c:\a")) Then
        fso.CreateFolder ("c:\a")
    End If
    
    If Not (fso.FolderExists("c:\a\b")) Then
        fso.CreateFolder ("c:\a\b")
    End If
__________________
Computer Specs: A computer, a big old monitor, keyboard, one of those mousy things for pointing

Last edited by matt.chugg; 09-25-06 at 09:30..
Reply With Quote
  #3  
Old 09-25-06, 10:34
ceal21c ceal21c is offline
Private First Class
 
Join Date: Mar 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Run-time error: '76' Path not found when creating a directory

Thanks for your reply matt. I understand your logic and I tried your suggestion but would you believe it, the program still crashes when it tries to create the subdirectory b when a is present on the root of c. I read somewhere that I may have to use a directory object instead of a file object. What do you think?
Reply With Quote
  #4  
Old 09-25-06, 11:11
ceal21c ceal21c is offline
Private First Class
 
Join Date: Mar 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Run-time error: '76' Path not found when creating a directory

Thanks to everyone for your help it turns out that the directory "C:\A" where I was trying to create the new folder "B" would only allow me to create the folder if I changed the name! I was trying to create a backup folder with the actual name "PRN" for storing some .prn files. Only after I changed the directory name to "BKP" did the program stop crashing and create the folder. Does this make any sense to anyone?
Reply With Quote
  #5  
Old 09-25-06, 11:32
matt.chugg's Avatar
matt.chugg matt.chugg is offline
Major Geek
 
Join Date: Jul 2006
Location: Cornwall UK
Posts: 3,260
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Run-time error: '76' Path not found when creating a directory

ahhh, if you'd have said PRN straigtaway I would have know the problem instantly.

There are several dos device names that are reserved, as such you cannot make a folder or file with their name.

Code:
AUX              First connected serial port
PRN              First connected parallel port
COM1 thru COM4   Serial ports (modem, mouse, etc.)
LPT1 thru LPT3   Parallel ports (printer)
CON              Keyboard and screen
NUL              Dummy (testing purposes)
__________________
Computer Specs: A computer, a big old monitor, keyboard, one of those mousy things for pointing
Reply With Quote
Sponsored links
  #6  
Old 09-26-06, 12:15
ceal21c ceal21c is offline
Private First Class
 
Join Date: Mar 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Run-time error: '76' Path not found when creating a directory

Ahhhhhhhhhhhhhhh..........Gotcha! Now it makes sense. Thanx again.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:41.


MajorGeeks.Com Home Page
| Admin Tools | All In One | Anti-Spyware | Anti-Virus | Appearance | Backup | Benchmarking | BIOS | Browsers | Covert Ops |
Data Recovery | Diagnostics | Drive Cleaners | Drive Utilities | Drivers | Driver Tools Ergonomics | Firewalls | Games | Game Tweaks | Graphics | Input Devices | Internet Tools | Macintosh | Mail Utilities | Memory | Messaging | Monitoring | Microsoft | Multimedia | Networking | Office Tools | Process Management | Processor | Registry | Security | System Info | Toys | Video | Miscellaneous
|
Powered by vBulletin® Version 3.8.4
Copyright © 2009 vBulletin Solutions, Inc. All rights reserved.
Ad Management by RedTyger