bug vbs 5.6 FSO with UNC path 
Author Message
 bug vbs 5.6 FSO with UNC path

I got this error :
Error :File not found, code 800A0035

This error occurs when I try to copy a file or create a folder with a UNC
path. This happens with files or folders with a long name and some spaces.

This error does NOT occur when I use a mapped drive instead of the UNC path.

Thanks for your help.



Fri, 02 Dec 2005 18:56:44 GMT  
 bug vbs 5.6 FSO with UNC path
Care to show the code?

Quote:

> I got this error :
> Error :File not found, code 800A0035

> This error occurs when I try to copy a file or create a folder with a
> UNC path. This happens with files or folders with a long name and some
> spaces.

> This error does NOT occur when I use a mapped drive instead of the UNC
> path.

> Thanks for your help.

--
Please respond in the newsgroup so everyone may benefit.
 http://dev.remotenetworktechnology.com
(email requests for support contract information welcomed)
 ----------
 Microsoft's new UNIFIED Terminal Services Newsgroup:



Fri, 02 Dec 2005 19:20:41 GMT  
 bug vbs 5.6 FSO with UNC path

Quote:

> The program is an incremental backup utility I rewrote for my company .
> I use a component called loginscreen to have a progress bar during the
> backup
> Because I am french

no problem.  If we ever have to vote on the 'right' language, we'll all
end up speaking Mandarin. ;)

Quote:
> and still I did not write the entire source
> code the source code may be difficult to read (I am sorry).

> The lines where the error occurs are :

> fso.CopyFile f1, backfolder, true 'LINE 395

> fso.CreateFolder( myFolder ) ' LINE 456

> More than 100 PCs are using this utility in my company.

> Many thanks

Oddly enough, I found a reference to an unusual bug here which looks
almost identical:

http://support.microsoft.com/?kbid=252607

It mentions printers, but in general the principal should be the same.

I am unable to replicate the problem right now copying locally, but it's
possible the situation is slightly different.  Could you provide the
following info as well?

+ Does this ALWAYS happen given a path with spaces in it?

+ What operating system are the clients running, and what version of WSH
do they have?

+ What is the OS on the server?

Those questions may be useless, but I'm hoping for a pattern that will
tell us something.

If there is nothing easy to find there, I can think of 2 avenues we may
want to explore.

(1) The Cop-Out: map a drive
This is the simplest solution and probably the most reliable.
Unfortunately the workstations may have different drives available. The
simplest way to do this is to find the next free drive letter within the
script, map a drive to that letter, and then unmap it when done.
Here's a function that will find that next drive for you:

function NextFreeDrive()
    ' returns next available drive letter
    dim available, drive, fso
    ' possible drive letters; we leave out A, and B because
    ' they are not mappable for some clients.
    available = "CDEFGHIJKLMNOPQRSTUVWXYZ"
    set fso = createobject("Scripting.FileSystemObject")
    for each drive in fso.drives
        available = replace(available, drive.DriveLetter, "")
    next
    NextFreeDrive = left(available, 1)
end function

(2) Possibly try variations on CopyFile
I doubt this is going to handle our problem, and it will require some
rewriting to use the Copy method. Instead of using

    fso.CopyFile f1, backfolder, true

you would do something like this:

    set thisfile = fso.GetFile(f1)
    thisfile.copy(backupfolder & "\" & thisfile.Name

There are a couple of other possibilities, but (1) is the first one to
try.

Quote:


>> Care to show the code?


>>> I got this error :
>>> Error :File not found, code 800A0035

>>> This error occurs when I try to copy a file or create a folder with a
>>> UNC path. This happens with files or folders with a long name and some
>>> spaces.

>>> This error does NOT occur when I use a mapped drive instead of the UNC
>>> path.

>>> Thanks for your help.

>> --
>> Please respond in the newsgroup so everyone may benefit.
>>  http://dev.remotenetworktechnology.com
>> (email requests for support contract information welcomed)
>>  ----------
>>  Microsoft's new UNIFIED Terminal Services Newsgroup:


--
Please respond in the newsgroup so everyone may benefit.
 http://dev.remotenetworktechnology.com
(email requests for support contract information welcomed)
 ----------
 Microsoft's new UNIFIED Terminal Services Newsgroup:



Fri, 02 Dec 2005 23:33:37 GMT  
 bug vbs 5.6 FSO with UNC path

Quote:
> I am unable to replicate the problem right now copying locally, but it's
> possible the situation is slightly different.  Could you provide the
> following info as well?

> + Does this ALWAYS happen given a path with spaces in it?

No it does not always happen... That's why it is so hard to find the error.

Quote:

> + What operating system are the clients running, and what version of WSH
> do they have?

Win98 or Win2000 or WinXP (5.5 or 5.6)

Quote:

> + What is the OS on the server?

Win2K advanced server

Thanks



Sat, 03 Dec 2005 14:14:52 GMT  
 bug vbs 5.6 FSO with UNC path
I 've just tried this :

set thisfolder = fso.GetFolder(myFolder)
fso.CreateFolder( thisfolder )

After having backuped several files, I've got this error :
error : Path Unreachable
Code : 800A004C
This error occurs on the GetFolder method...

I think I will map a drive with your cool NextFreeDrive function and then
remove this drive...



Quote:

> > The program is an incremental backup utility I rewrote for my company .
> > I use a component called loginscreen to have a progress bar during the
> > backup

> > Because I am french

> no problem.  If we ever have to vote on the 'right' language, we'll all
> end up speaking Mandarin. ;)

> > and still I did not write the entire source
> > code the source code may be difficult to read (I am sorry).

> > The lines where the error occurs are :

> > fso.CopyFile f1, backfolder, true 'LINE 395

> > fso.CreateFolder( myFolder ) ' LINE 456

> > More than 100 PCs are using this utility in my company.

> > Many thanks

> Oddly enough, I found a reference to an unusual bug here which looks
> almost identical:

> http://support.microsoft.com/?kbid=252607

> It mentions printers, but in general the principal should be the same.

> I am unable to replicate the problem right now copying locally, but it's
> possible the situation is slightly different.  Could you provide the
> following info as well?

> + Does this ALWAYS happen given a path with spaces in it?

> + What operating system are the clients running, and what version of WSH
> do they have?

> + What is the OS on the server?

> Those questions may be useless, but I'm hoping for a pattern that will
> tell us something.

> If there is nothing easy to find there, I can think of 2 avenues we may
> want to explore.

> (1) The Cop-Out: map a drive
> This is the simplest solution and probably the most reliable.
> Unfortunately the workstations may have different drives available. The
> simplest way to do this is to find the next free drive letter within the
> script, map a drive to that letter, and then unmap it when done.
> Here's a function that will find that next drive for you:

> function NextFreeDrive()
>     ' returns next available drive letter
>     dim available, drive, fso
>     ' possible drive letters; we leave out A, and B because
>     ' they are not mappable for some clients.
>     available = "CDEFGHIJKLMNOPQRSTUVWXYZ"
>     set fso = createobject("Scripting.FileSystemObject")
>     for each drive in fso.drives
>         available = replace(available, drive.DriveLetter, "")
>     next
>     NextFreeDrive = left(available, 1)
> end function

> (2) Possibly try variations on CopyFile
> I doubt this is going to handle our problem, and it will require some
> rewriting to use the Copy method. Instead of using

>     fso.CopyFile f1, backfolder, true

> you would do something like this:

>     set thisfile = fso.GetFile(f1)
>     thisfile.copy(backupfolder & "\" & thisfile.Name

> There are a couple of other possibilities, but (1) is the first one to
> try.



> >> Care to show the code?


> >>> I got this error :
> >>> Error :File not found, code 800A0035

> >>> This error occurs when I try to copy a file or create a folder with a
> >>> UNC path. This happens with files or folders with a long name and some
> >>> spaces.

> >>> This error does NOT occur when I use a mapped drive instead of the UNC
> >>> path.

> >>> Thanks for your help.

> >> --
> >> Please respond in the newsgroup so everyone may benefit.
> >>  http://dev.remotenetworktechnology.com
> >> (email requests for support contract information welcomed)
> >>  ----------
> >>  Microsoft's new UNIFIED Terminal Services Newsgroup:

> --
> Please respond in the newsgroup so everyone may benefit.
>  http://dev.remotenetworktechnology.com
> (email requests for support contract information welcomed)
>  ----------
>  Microsoft's new UNIFIED Terminal Services Newsgroup:




Sat, 03 Dec 2005 16:26:14 GMT  
 bug vbs 5.6 FSO with UNC path

Quote:

> I 've just tried this :

> set thisfolder = fso.GetFolder(myFolder)
> fso.CreateFolder( thisfolder )

> After having backuped several files, I've got this error :
> error : Path Unreachable
> Code : 800A004C
> This error occurs on the GetFolder method...

I am suspicious of possible underlying network communication problems
here, since not being able to find a path during rapid calls to operations
like this is frequently a symptom.

Let's see if the problem occurs with the mapped drive, and if so whether
the frequency of occurrence decreases.

Quote:

> I think I will map a drive with your cool NextFreeDrive function and
> then remove this drive...




>>> The program is an incremental backup utility I rewrote for my company
>>> . I use a component called loginscreen to have a progress bar during
>>> the backup

>>> Because I am french

>> no problem.  If we ever have to vote on the 'right' language, we'll all
>> end up speaking Mandarin. ;)

>>> and still I did not write the entire source
>>> code the source code may be difficult to read (I am sorry).

>>> The lines where the error occurs are :

>>> fso.CopyFile f1, backfolder, true 'LINE 395

>>> fso.CreateFolder( myFolder ) ' LINE 456

>>> More than 100 PCs are using this utility in my company.

>>> Many thanks

>> Oddly enough, I found a reference to an unusual bug here which looks
>> almost identical:

>> http://support.microsoft.com/?kbid=252607

>> It mentions printers, but in general the principal should be the same.

>> I am unable to replicate the problem right now copying locally, but
>> it's possible the situation is slightly different.  Could you provide
>> the following info as well?

>> + Does this ALWAYS happen given a path with spaces in it?

>> + What operating system are the clients running, and what version of
>> WSH do they have?

>> + What is the OS on the server?

>> Those questions may be useless, but I'm hoping for a pattern that will
>> tell us something.

>> If there is nothing easy to find there, I can think of 2 avenues we may
>> want to explore.

>> (1) The Cop-Out: map a drive
>> This is the simplest solution and probably the most reliable.
>> Unfortunately the workstations may have different drives available. The
>> simplest way to do this is to find the next free drive letter within
>> the script, map a drive to that letter, and then unmap it when done.
>> Here's a function that will find that next drive for you:

>> function NextFreeDrive()
>>     ' returns next available drive letter
>>     dim available, drive, fso
>>     ' possible drive letters; we leave out A, and B because
>>     ' they are not mappable for some clients.
>>     available = "CDEFGHIJKLMNOPQRSTUVWXYZ"
>>     set fso = createobject("Scripting.FileSystemObject")
>>     for each drive in fso.drives
>>         available = replace(available, drive.DriveLetter, "")
>>     next
>>     NextFreeDrive = left(available, 1)
>> end function

>> (2) Possibly try variations on CopyFile
>> I doubt this is going to handle our problem, and it will require some
>> rewriting to use the Copy method. Instead of using

>>     fso.CopyFile f1, backfolder, true

>> you would do something like this:

>>     set thisfile = fso.GetFile(f1)
>>     thisfile.copy(backupfolder & "\" & thisfile.Name

>> There are a couple of other possibilities, but (1) is the first one to
>> try.



>>>> Care to show the code?


>>>>> I got this error :
>>>>> Error :File not found, code 800A0035

>>>>> This error occurs when I try to copy a file or create a folder with
>>>>> a UNC path. This happens with files or folders with a long name and
>>>>> some spaces.

>>>>> This error does NOT occur when I use a mapped drive instead of the
>>>>> UNC path.

>>>>> Thanks for your help.

>>>> --
>>>> Please respond in the newsgroup so everyone may benefit.
>>>>  http://dev.remotenetworktechnology.com
>>>> (email requests for support contract information welcomed)
>>>>  ----------
>>>>  Microsoft's new UNIFIED Terminal Services Newsgroup:

>> --
>> Please respond in the newsgroup so everyone may benefit.
>>  http://dev.remotenetworktechnology.com
>> (email requests for support contract information welcomed)
>>  ----------
>>  Microsoft's new UNIFIED Terminal Services Newsgroup:


--
Please respond in the newsgroup so everyone may benefit.
 http://dev.remotenetworktechnology.com
(email requests for support contract information welcomed)
 ----------
 Microsoft's new UNIFIED Terminal Services Newsgroup:



Sun, 04 Dec 2005 07:28:04 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. bug FSO with UNC path

2. ASP/WSH UNC path bug?

3. Converting logical paths to UNC paths

4. Converting logical paths to UNC paths

5. Converting local path to UNC path?

6. WSC CreateObject fails: Bug in WSH 5.6?

7. RegExp bug (Windows Script 5.6)?

8. BUG in WSH 5.6 install if Wscript.exe is running while updating WSH

9. bug in wsh 5.6 doesn't respect interfaces like 5.5

10. BUG in WSH 5.6 install if Wscript.exe is running while updating WSH

11. WSH 5.6 release bug (stdin/stdout)

12. WSH 5.6 bug report - StdIn.AtEndOfLine doesn't work

 

 
Powered by phpBB® Forum Software