OK lets start over, how would you do this script?
set WshShell = WScript.CreateObject("WScript.Shell")
dFolder = WshShell.ExpandEnvironmentStrings("%UserProfile%") & _
"\appData\Roaming\Microsoft\Windows\cookies"
Set fso = CreateObject("Scripting.FileSystemObject")
Set Fldr = fso.GetFolder(dFolder)
For each file in Fldr.files
If Ucase(Left(File.Name, 6)) = "COOKIE" Then
'wscript.echo file
fso.DeleteFile(file)
End if
wscript.echo file
Next
"Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
news:OTniRYVzIHA.3496@xxxxxx
> "Todd Vargo" <tlvargo@xxxxxx> wrote:
>
> Your address is wrong!
>
> [ very clumsy way to get the cookie jar ]
>
>> You have to use ExpandEnvironmentStrings method to retrieve %UserProfile%
>> from the environment.
>>
>> Try this...
>>
>> set WshShell = WScript.CreateObject("WScript.Shell")
>> dFolder = WshShell.ExpandEnvironmentStrings("%UserProfile%") & _
>> "\appData\Roaming\Microsoft\Windows\cookies" >
> That's clumsy too!
> And on Vista AFAIK %LocalAppData% has been introduced, so it is
> advisable to use that environment variable in REAL batch scripts.
>
>
> WScript.CreateObject("Shell.Application").NameSpace(21).Self.Path
>
> is THE on and only way to retrieve the location of the current users
> cookie folder on all versions and all languages of Windows.
>
> Stefan
>