FSO problem

M

middletree

I asked this a few weeks ago, but still haven't gotten an answer. Really
stumped.

Intranet app, for tech support, and this app tracks the progress of tickets.
Sometimes, the customer will send us some trace files or logs, so we have a
folder called Tickets on a server on our network. If a ticket number is
1000, then the folder will be called T1000. So I have a link to that
directory that looks like this:

<% SET fso = CreateObject("Scripting.FileSystemObject")
strTraceDir = "\\servername\Tickets\T"&strTicketID
If fso.FolderExists(strTraceDir) then

Else
strTraceDir = "\\servername\Tickets\"
End if
set fso= nothing
%>

<a href="<%=strTraceDir%>" target="_blank">Files:</a>

As you can see, I cannot just assume that there is a folder with a specific
number. Perhaps Ticket 1000 doesn't have a folder yet. If not, then I want
to allow the link to take you to just the root of that drive.

Here's the problem: On my dev machine, this code works fine. When I upload
it to production, the FolderExists part never, ever comes into play. In
other words, it always falls into the Else condition, every time. It's as if
you can't see the folder from the server. But I have checked into that and
you can see it just fine. I also tried to see if the fact that it wasn't
mapped as a drive might be the problem, but I don't think that's it. I also
checked to see that the IUSR account info is the same on both. IIS settings
seem to be the same.

If my code just didn't work, I could deal with that. But the fact that it
doesn't work on production, but does work from my dev machine, both of which
are on the same domain, and both of which have the same permissions, is what
I am not getting.
 
C

Curt_C [MVP]

You say they BOTH run under the same account? is it an IUSR account or a
standard account. As a test try setting both to run under an admin account,
this will eliminate the permissions as an issue.
 
C

Curt_C [MVP]

Oh, and make sure that both know the \\servername\ translation (try IP in
other words)
 
M

middletree

I should have mentioned that in my testing (I've been wrestling with this
for weeks now), I tried the IP address. I'll check the admin account, but
don't think I will be allowed to keep it there.

Keep in mind that although I said it seems like a permissions problem, it's
not necessarily. All I can say for sure is that it acts as if the folder
does not exist.
 
M

middletree

I should also add that I had someone else create a folder on the drive,
thinking perhaps it was giving me permissions to see only those folders I
created myself. But that theory was wrong, as well.
 
J

JJ

What happens if you do something like:

set wshell = CreateObject("WScript.Shell")
wshell.run "%COMSPEC% /C dir \\servername\Tickets >c:\dir.txt 2>&1", 0,
TRUE
set wshell = nothing

The file c:\dir.txt will either have the directory listing in it or an error
message that might help.
 
M

middletree

Well, I could try this for debugging, but I don't think I could normally get
into the root of the C drive on that server. We're mapped to the shared
folder itself.
 
C

Curt_C [MVP]

Definitly DONT keep it there...just put it there for one quick test.
It will tell you if it's permissions or not then and where to look for the
fix

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
 
M

middletree

JJ said:
What happens if you do something like:

set wshell = CreateObject("WScript.Shell")
wshell.run "%COMSPEC% /C dir \\servername\Tickets >c:\dir.txt 2>&1", 0,
TRUE
set wshell = nothing

The file c:\dir.txt will either have the directory listing in it or an error
message that might help.


I just went to our systems admin, got special permission to look at the C
drive of that server, and there was no such file as dir.txt
 
M

middletree

Mike Florio said:
What exactly do you get when you Response.Write strTraceDir ?

\\servername\Tickets\T11026, on my dev machine99which is not giving me
problems; And yes, in this case, 11026 is the correct number

I did not do the response.write for production, which is where I am getting
problems. I could not do that while people are using it, maybe after hours.
But I don't think I'll see anything new, because the word "Files" has a
hyperlink to that path, and I can see when I mouseover "Files", in the
status bar, and I can see when I click "Files", it brings up an Explorer
window. So I am quite sure that it is giving me \\servername\Tickets\, when
I would rather have \\servername\Tickets\T11026



Might you need a space somewhere in "\\servername\Tickets\T"&strTicketID ?

No, can't see where that would be appropriate.
 
T

TomB

I assume this is on an intranet (not the S.H.A.P.E. thing) as it would be
pointless on the internet.
I further assume that the intranet server is a member of the domain.

If this assumptions are correct, than you would be just as well off to run
the application under Windows Authentication instead of Anonymous.

Then, each request to check for the existence of \\servername\Tickets\TXXXXX
would run under the end user's context.
This is similar to the "Can I connect to an Access database on a different
server" problem.

http://www.aspfaq.com/show.asp?id=2168
under If the file is within your LAN
 
M

middletree

Your first assumptions are correct. This project is part of my job. SHAPE is
something I am doing at home for church.
The Intranet server is on the same domain as all users who would use this
app.

You lost me when you said to run it under Window Authentication. Is this a
setting on IIS? I know of a setting with a similar name, for SQL Server, but
that wouldn't apply to this problem.

Oh, wait, I read the article. Are you talking about going into IIS and
checking the Windows authentication checkbox? I checked that a few weeks
ago, when this problem first started. It's already checked.
 
B

Bob Barrows

middletree said:
Your first assumptions are correct. This project is part of my job.
SHAPE is something I am doing at home for church.
The Intranet server is on the same domain as all users who would use
this app.

You lost me when you said to run it under Window Authentication. Is
this a setting on IIS? I know of a setting with a similar name, for
SQL Server, but that wouldn't apply to this problem.

Oh, wait, I read the article. Are you talking about going into IIS and
checking the Windows authentication checkbox?
Right

I checked that a few
weeks ago, when this problem first started. It's already checked.

And Anonymous is unchecked?

Bob Barrows
 
J

JJ

You don't have to put it in c:\ - you can put the file anywhere. I just
used c:\dir.txt as an example. But I would use the local hard drive of the
web server, not a network share.

When I do those commands from an ASP script (assuming WSH is installed), I
get either a directory listing in the file or I get the error message from
dir, which sometimes helps determine the problem.
 
M

middletree

Ok, I totally misunderstood what you are saying, then. I guess I can try and
run it, and see what happens. I'll do it on my dev server first, though.
 
T

TomB

Oh, I forgot if you use Windows Authentication it can't pass the credentials
there are only two ways of making this work

1) Use Basic Authentication. You probably don't want to as your users will
have to login.
2) Run under Anonymous but under a domain account, rather than IUSR_
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

filescriptingobject problem 3
Just finished my first major project! 3
FSO 6
IF exist /w FSO 2
FSO: Localhost has stopped working? 4
Timing problem 4
ASP FSO File Name Problem 0
Mapped drives and FSO 3

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top