Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FSO, Scripting.FileSystemObject

Status
Not open for further replies.

shaddow

Programmer
Mar 22, 2001
1,862
0
0
RO
I've seen lately to many FSO and Network share problems.
Maybe creating this thread will helo find the solution faster.
Code:
Set ws = CreateObject("WScript.Network.1")
'Drive map the share ws.MapNetworkDrive "Z:", "\\MyServer\public",false,user,pass
'do your job using Z drive

'remove the drive map
ws.RemoveNetworkDrive "Z:",true


________
George, M
 
Try Set ws = CreateObject("WScript.Network")

instead of Set ws = CreateObject("WScript.Network.1")

Also, the fact that you are using the false for the map network drives might cause you some unexpected results since the mapping is not persistant.
 
I've been experiencing about 2 or 3 years ago same problem, when using FSO and shared resources. It doesnt worked until i've used Mapped drives.
And i noticed that any FSO and Shared resources problems still exists, nothing changed with FSO shared resources access or maybe i'm wrong.

I'm waiting confirmations.

________
George, M
 
I wonder why this error when executing this code
Code:
test.txt contains word "aaaa"
<%
set fso=CreateObject(&quot;Scripting.FileSystemObject&quot;)
set file=fso.OpenTextFile (&quot;\\server1\share\test.txt&quot;,1)
Response.Write file.ReadAll
%>

Error

error '8007052e' 
/tek/fso/index.asp, line 3 

Posible explanation

8007052e - Logon failure: unknown user name or bad password.

THis looks like the IUSR_computer name has no right on that share, but that's not true. I have Everyone on that share with full access.

Not to mention that i've seen some programs that will not work with shared resources unless i map them to an drive.

________
George, M
 
shaddow, I didn't realize that you used fso in asp.
Within WSH shared names are perfectly legal with fso.
 
AHA, i tought it's same as on ASP.
I've never used other then a simple VBS file or from ASP.

________
George, M
 
Yes, now i understand why. But i wonder why my example didnt worked even i had Everyone set to full on the share. Maybe IUSR_machine doesnt work with Everyone.
That was the main problem here, never tought to add IUSR_machine in the user list of the share. But since Everyone didnt worked i assumed that IUSR wont work also.

But it's good i finally found that was a &quot;DESIGN&quot; error and not program. Anyway using the map drive workaround solved the authentication isue.

:)

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top