Hi,

I have the following code to get the folder path:

Set oFileSystem =Server.CreateObject("Scripting.FileSystemObject")
Set tfolder = oFileSystem.GetSpecialFolder(2)

Response.Write(tfolder) will display as C:\windows\Temp

Now I need to get a substring of this result. I cannot use any string
functions as it is giving an error.

Any ideas?

Thanks,
Anishya

Re: Converting object to string by Ray

Ray
Thu Jun 08 08:26:29 CDT 2006

What substring? And what do you mean you can't use any string functions?
Is this a logic test or something?

Ray at work

"Ani" <anishya@gmail.com> wrote in message
news:1149772326.704083.181230@h76g2000cwa.googlegroups.com...
> Hi,
>
> I have the following code to get the folder path:
>
> Set oFileSystem =Server.CreateObject("Scripting.FileSystemObject")
> Set tfolder = oFileSystem.GetSpecialFolder(2)
>
> Response.Write(tfolder) will display as C:\windows\Temp
>
> Now I need to get a substring of this result. I cannot use any string
> functions as it is giving an error.
>
> Any ideas?
>
> Thanks,
> Anishya
>



Re: Converting object to string by mayayana

mayayana
Thu Jun 08 08:28:50 CDT 2006

Skip the "Set". If you just use:

sFolder = oFileSystem.GetSpecialFolder(2)

you'll get the path string. If you want to use the object
approach you need to use the Path property of the
folder object to get the string.

(It's a bit confusing. I think the reason it works both
ways is because the path is considered the "default"
property of the object.)

>
> I have the following code to get the folder path:
>
> Set oFileSystem =Server.CreateObject("Scripting.FileSystemObject")
> Set tfolder = oFileSystem.GetSpecialFolder(2)
>
> Response.Write(tfolder) will display as C:\windows\Temp
>
> Now I need to get a substring of this result. I cannot use any string
> functions as it is giving an error.
>
> Any ideas?
>
> Thanks,
> Anishya
>



Re: Converting object to string by Richard

Richard
Thu Jun 08 09:39:47 CDT 2006

Hi,

Just to clarify:

sFolder = oFileSystem.GetSpecialFolder(2)

is equivalent to:

sFolder = oFileSystem.GetSpecialFolder(2).Path

I would use:

Set oFolder = oFileSystem.GetSpecialFolder(2)
Response.Write(oFolder.Path)

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"mayayana" <mayaXXyana1a@mindXXspring.com> wrote in message
news:mCVhg.3202$lf4.2148@newsread1.news.pas.earthlink.net...
> Skip the "Set". If you just use:
>
> sFolder = oFileSystem.GetSpecialFolder(2)
>
> you'll get the path string. If you want to use the object
> approach you need to use the Path property of the
> folder object to get the string.
>
> (It's a bit confusing. I think the reason it works both
> ways is because the path is considered the "default"
> property of the object.)
>
>>
>> I have the following code to get the folder path:
>>
>> Set oFileSystem =Server.CreateObject("Scripting.FileSystemObject")
>> Set tfolder = oFileSystem.GetSpecialFolder(2)
>>
>> Response.Write(tfolder) will display as C:\windows\Temp
>>
>> Now I need to get a substring of this result. I cannot use any string
>> functions as it is giving an error.
>>
>> Any ideas?
>>
>> Thanks,
>> Anishya
>>
>
>



Re: Converting object to string by Ani

Ani
Thu Jun 08 23:26:25 CDT 2006

Thanks Richard.
That worked!!!

Richard Mueller wrote:
> Hi,
>
> Just to clarify:
>
> sFolder = oFileSystem.GetSpecialFolder(2)
>
> is equivalent to:
>
> sFolder = oFileSystem.GetSpecialFolder(2).Path
>
> I would use:
>
> Set oFolder = oFileSystem.GetSpecialFolder(2)
> Response.Write(oFolder.Path)
>
> --
> Richard
> Microsoft MVP Scripting and ADSI
> Hilltop Lab - http://www.rlmueller.net
>
> "mayayana" <mayaXXyana1a@mindXXspring.com> wrote in message
> news:mCVhg.3202$lf4.2148@newsread1.news.pas.earthlink.net...
> > Skip the "Set". If you just use:
> >
> > sFolder = oFileSystem.GetSpecialFolder(2)
> >
> > you'll get the path string. If you want to use the object
> > approach you need to use the Path property of the
> > folder object to get the string.
> >
> > (It's a bit confusing. I think the reason it works both
> > ways is because the path is considered the "default"
> > property of the object.)
> >
> >>
> >> I have the following code to get the folder path:
> >>
> >> Set oFileSystem =Server.CreateObject("Scripting.FileSystemObject")
> >> Set tfolder = oFileSystem.GetSpecialFolder(2)
> >>
> >> Response.Write(tfolder) will display as C:\windows\Temp
> >>
> >> Now I need to get a substring of this result. I cannot use any string
> >> functions as it is giving an error.
> >>
> >> Any ideas?
> >>
> >> Thanks,
> >> Anishya
> >>
> >
> >