Path not found error?? 
Author Message
 Path not found error??

Hello,

I'm having a strange error when I try to rename a folder using the .folder
property.  When I run the following code:

---
' To rename a folder

Dim fso, folder1
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder1 = fso.GetFolder("c:\chaz")

msgbox folder1.Name
folder1.Name = "chazrenamed"
msgbox folder1.Name        ' *****

WSCript.quit

---

the WSH will return a runtime error stating "Path not found" at the second
msgbox folder1.Name line above (the ***** line).  And then, when I then open
up Windows explorer to look at the folder, the folder has not been renamed!

This is a particularly odd problem because I only run into it on certain
computers, and not others.  When I copy the exact same code over to a
computer next to me, also running Win98, it works fine, but on my computer
here, it doesn't.

Anyone have any ideas?

Charles



Sat, 09 Nov 2002 03:00:00 GMT  
 Path not found error??

Ahh!

FYI -- just to let any of you know, in case you're having the same problem:

I've solved the problem by installing WSH 2.0.  Apparently there was some
bug in the previous version of WSH which prevented it from working properly.

Charles


Quote:

> Hello,

> I'm having a strange error when I try to rename a folder using the .folder
> property.  When I run the following code:

> ---
> ' To rename a folder

> Dim fso, folder1
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set folder1 = fso.GetFolder("c:\chaz")

> msgbox folder1.Name
> folder1.Name = "chazrenamed"
> msgbox folder1.Name        ' *****

> WSCript.quit

> ---

> the WSH will return a runtime error stating "Path not found" at the second
> msgbox folder1.Name line above (the ***** line).  And then, when I then
open
> up Windows explorer to look at the folder, the folder has not been
renamed!

> This is a particularly odd problem because I only run into it on certain
> computers, and not others.  When I copy the exact same code over to a
> computer next to me, also running Win98, it works fine, but on my computer
> here, it doesn't.

> Anyone have any ideas?

> Charles



Sat, 09 Nov 2002 03:00:00 GMT  
 Path not found error??
My guess would be that a folder named chazrenamed already exists

--
Mark L. Ferguson    Please reply in Newsgroup
marfer's notes for OE 5 > http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> Hello,

> I'm having a strange error when I try to rename a folder using the .folder
> property.  When I run the following code:

> ---
> ' To rename a folder

> Dim fso, folder1
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set folder1 = fso.GetFolder("c:\chaz")

> msgbox folder1.Name
> folder1.Name = "chazrenamed"
> msgbox folder1.Name        ' *****

> WSCript.quit

> ---

> the WSH will return a runtime error stating "Path not found" at the second
> msgbox folder1.Name line above (the ***** line).  And then, when I then open
> up Windows explorer to look at the folder, the folder has not been renamed!

> This is a particularly odd problem because I only run into it on certain
> computers, and not others.  When I copy the exact same code over to a
> computer next to me, also running Win98, it works fine, but on my computer
> here, it doesn't.

> Anyone have any ideas?

> Charles



Sat, 09 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VBScript Path Not Found Error when running in IIS

2. Path not found error??

3. VBScript Path Not Found Error when running in IIS

4. Long Path Names give Runtime error 76 - Path not found

5. Long Path Names give Runtime error 76 - Path not found

6. Error 76 Path not found with folder object

7. The network path was not found error

8. GetFolder - Path Not Found

9. GetFolder gives me PATH not found

10. Path not found in W95

11. objFolder.Size not finding correct path.

12. Path not found

 

 
Powered by phpBB® Forum Software