map network drive & getFile 
Author Message
 map network drive & getFile

How could I open a file with getFile method which is on a map network drive?

Ex:
the map network drive is H:
the file name is aaaa.doc

  Dim fso, f
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.GetFile(filespec)   '-------- an error occuers: "File Not
Found"

where filespec is the parameter of function with "H:\xxx\aaaa.doc" value



Tue, 01 Apr 2003 03:00:00 GMT  
 map network drive & getFile

Quote:

> How could I open a file with getFile method which is on a map network drive?

> Ex:
> the map network drive is H:
> the file name is aaaa.doc

>   Dim fso, f
>   Set fso = CreateObject("Scripting.FileSystemObject")
>   Set f = fso.GetFile(filespec)   '-------- an error occurs: "File Not
> Found"

> where filespec is the parameter of function with "H:\xxx\aaaa.doc" value

Do you ever equate the variable 'filespec' with your actual filespec
before you reference it in the GetFile?  For example, ...

  filespec = "H:\xxx\aaaa.doc"
  Dim fso, f
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.GetFile(filespec)

You do realize that is what is intended in the example, don't you?

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Tue, 01 Apr 2003 03:00:00 GMT  
 map network drive & getFile

What's the host environment for the script?  WSH, ASP, client side script in
IE, ???

--
Michael Harris
Microsoft.MVP.Scripting
--


Quote:
> How could I open a file with getFile method which is on a map network
drive?

> Ex:
> the map network drive is H:
> the file name is aaaa.doc

>   Dim fso, f
>   Set fso = CreateObject("Scripting.FileSystemObject")
>   Set f = fso.GetFile(filespec)   '-------- an error occuers: "File Not
> Found"

> where filespec is the parameter of function with "H:\xxx\aaaa.doc" value



Tue, 01 Apr 2003 03:00:00 GMT  
 map network drive & getFile
I think he gets that filespec should be the name of the file.
i read an article on 4guysfromrolla.com

http://www.4guysfromrolla.com/webtech/faq/FileSystemObject/faq6.shtml

about not being able to access files on a remote computer (or share) on
IIS 4. it pointed to a m$ technet file

http://support.microsoft.com/support/kb/articles/q197/9/64.asp?
LNG=ENG&SA=PER

that talked about it too. they went on to say that the "bug" is fixed
in win2k yet i'm trying to access a file on a remote computer and it's
giving me "file not found" yet i can go to the command prompt and type
dir f:\ws_ftp.log and it will list the file.

f is the drive. i've even tried \\machinename\ws_ftp.log (it's in the
root) to no avail.

HELP!

=raman



Quote:

> > How could I open a file with getFile method which is on a map
network drive?

> > Ex:
> > the map network drive is H:
> > the file name is aaaa.doc

> >   Dim fso, f
> >   Set fso = CreateObject("Scripting.FileSystemObject")
> >   Set f = fso.GetFile(filespec)   '-------- an error occurs: "File
Not
> > Found"

> > where filespec is the parameter of function with "H:\xxx\aaaa.doc"
value

> Do you ever equate the variable 'filespec' with your actual filespec
> before you reference it in the GetFile?  For example, ...

>   filespec = "H:\xxx\aaaa.doc"
>   Dim fso, f
>   Set fso = CreateObject("Scripting.FileSystemObject")
>   Set f = fso.GetFile(filespec)

> You do realize that is what is intended in the example, don't you?

> Tom Lavedas
> -----------
> http://www.pressroom.com/~tglbatch/

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 06 Apr 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. get drive size from network network mapped drives

2. rename a drive / map network drive

3. Network Drive mapping?

4. mapping a network drive

5. Mapping a network drive

6. Mapping Network Drives

7. If member of a group then map network drive

8. Mapping and removing Network Drives using VB

9. Map a Network Drive

10. Change Mapped Network Drive

11. Permanently Map Network Drive

12. Nope, still don't got it -Map Network Drive across Domains

 

 
Powered by phpBB® Forum Software