469,622 Members | 2,155 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,622 developers. It's quick & easy.

filescriptingobject problem

On an Intranet app, I want the user to be able to click the word Files, and
be taken to the folder that exists for that particular ticket. On a server
on our network, we have a folder called tickets, and inside, if anyone has
created a folder for a given ticket, it will have the naming convention of
T, then the ticket number. So Ticket #1000 will have a folder called T1000,
and it will be located on the folder called Tickets on that server.

However, if no folder has been created, then I want it to take them to the
root of the Tickets folder. Here's the code, with problem listed below that.

SET fso = CreateObject("Scripting.FileSystemObject")
strTraceDir = "\\servername\tickets\T"&strTicketID
If fso.FolderExists (strTraceDir) then
'don't change anything
Else
strTraceDir = "\\servername\tickets\"
End if
set fso= nothing
%>

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

------------------------------------
For some reason, it is falling into the Else no matter what. Even though the
folder exists, it acts as if it doesn't. It jsut takes you to the root of
Tickets.

I did a response.write on several things, and confirmed that the strTicketID
variable is properly populated. What am I missing?


Jul 19 '05 #1
3 3181
Dim FSO
Dim Fldr
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fldr = FSO.GetFolder(Server.MapPath(""\\servername\ticket s"))

If FSO.FolderExists(Server.MapPath(Fldr.Name & "\T"& strTicketID")) Then
'it is there
'Do something
Else 'It's not there
'Do something else
End If

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
middletree <mi********@htomail.com> wrote in message
news:#D**************@TK2MSFTNGP12.phx.gbl...
On an Intranet app, I want the user to be able to click the word Files, and be taken to the folder that exists for that particular ticket. On a server on our network, we have a folder called tickets, and inside, if anyone has
created a folder for a given ticket, it will have the naming convention of
T, then the ticket number. So Ticket #1000 will have a folder called T1000, and it will be located on the folder called Tickets on that server.

However, if no folder has been created, then I want it to take them to the
root of the Tickets folder. Here's the code, with problem listed below that.
SET fso = CreateObject("Scripting.FileSystemObject")
strTraceDir = "\\servername\tickets\T"&strTicketID
If fso.FolderExists (strTraceDir) then
'don't change anything
Else
strTraceDir = "\\servername\tickets\"
End if
set fso= nothing
%>

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

------------------------------------
For some reason, it is falling into the Else no matter what. Even though the folder exists, it acts as if it doesn't. It jsut takes you to the root of
Tickets.

I did a response.write on several things, and confirmed that the strTicketID variable is properly populated. What am I missing?

Jul 19 '05 #2
Are you sure IUSR has permissions to the \\servername\tickets\ folder?

"middletree" <mi********@htomail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
On an Intranet app, I want the user to be able to click the word Files, and be taken to the folder that exists for that particular ticket. On a server on our network, we have a folder called tickets, and inside, if anyone has
created a folder for a given ticket, it will have the naming convention of
T, then the ticket number. So Ticket #1000 will have a folder called T1000, and it will be located on the folder called Tickets on that server.

However, if no folder has been created, then I want it to take them to the
root of the Tickets folder. Here's the code, with problem listed below that.
SET fso = CreateObject("Scripting.FileSystemObject")
strTraceDir = "\\servername\tickets\T"&strTicketID
If fso.FolderExists (strTraceDir) then
'don't change anything
Else
strTraceDir = "\\servername\tickets\"
End if
set fso= nothing
%>

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

------------------------------------
For some reason, it is falling into the Else no matter what. Even though the folder exists, it acts as if it doesn't. It jsut takes you to the root of
Tickets.

I did a response.write on several things, and confirmed that the strTicketID variable is properly populated. What am I missing?

Jul 19 '05 #3
Yes, I am.

I am not sure why, but it began working all of a sudden.
"Foo Man Chew" <fo*@man.chew> wrote in message
news:#O**************@TK2MSFTNGP12.phx.gbl...
Are you sure IUSR has permissions to the \\servername\tickets\ folder?

"middletree" <mi********@htomail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
On an Intranet app, I want the user to be able to click the word Files,

and
be taken to the folder that exists for that particular ticket. On a

server
on our network, we have a folder called tickets, and inside, if anyone has created a folder for a given ticket, it will have the naming convention of T, then the ticket number. So Ticket #1000 will have a folder called

T1000,
and it will be located on the folder called Tickets on that server.

However, if no folder has been created, then I want it to take them to the root of the Tickets folder. Here's the code, with problem listed below

that.

SET fso = CreateObject("Scripting.FileSystemObject")
strTraceDir = "\\servername\tickets\T"&strTicketID
If fso.FolderExists (strTraceDir) then
'don't change anything
Else
strTraceDir = "\\servername\tickets\"
End if
set fso= nothing
%>

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

------------------------------------
For some reason, it is falling into the Else no matter what. Even though

the
folder exists, it acts as if it doesn't. It jsut takes you to the root of Tickets.

I did a response.write on several things, and confirmed that the

strTicketID
variable is properly populated. What am I missing?


Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Bruce Davis | last post: by
11 posts views Thread by Kostatus | last post: by
117 posts views Thread by Peter Olcott | last post: by
1 post views Thread by Jeff | last post: by
28 posts views Thread by Jon Davis | last post: by
6 posts views Thread by Ammar | last post: by
2 posts views Thread by Mike Collins | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.