Hi everyone,
Last week I sought assistance for defining a "relative path" to the Windows "Cookie" folder, and received excellent help from both "arb" and "mwreyf1" (thanks guys) ... whose solutions worked a treat.
I am now however, seeking further assistance on this issue because although the solutions posed, work well on Windows-XP, they unfortunatley do not work on Windows Vista & older versions of Windows such as Windows'95/'98. This is because the location of the "Cookies" folder is different on those operating sysytems.
Here's my problem:
I need to define a 'relative pathway' to the "Cookies" folder, so I can delete a file there (ie. "abc.txt") regardless of the drive on which Windows is installed. On Windows-XP, the "Cookies" folder is located at: Local Drive\Documents and Settings\User\Cookies.
"Arb" came up with the following solution:
"mwreyf1" came up with an alternate solution:
Now, as I said, both these solutions work a treat on Windows-XP ... but not on Windows Vista, nor on Windows'95/98/ME/NT ... because of the different location of the "Cookies" folder.
So ideally, what I would like to do, is to use either "arb's" or "mwreyf1's" solution together with a solution that works on Vista & the older versions of Windows. So essentially, what I need is, 'relative pathways' for the following:
Windows Vista:
AND
Windows 95/98/ME/NT
Can anyone help me figure this out because it's got me stumped?
Last week I sought assistance for defining a "relative path" to the Windows "Cookie" folder, and received excellent help from both "arb" and "mwreyf1" (thanks guys) ... whose solutions worked a treat.
I am now however, seeking further assistance on this issue because although the solutions posed, work well on Windows-XP, they unfortunatley do not work on Windows Vista & older versions of Windows such as Windows'95/'98. This is because the location of the "Cookies" folder is different on those operating sysytems.
Here's my problem:
I need to define a 'relative pathway' to the "Cookies" folder, so I can delete a file there (ie. "abc.txt") regardless of the drive on which Windows is installed. On Windows-XP, the "Cookies" folder is located at: Local Drive\Documents and Settings\User\Cookies.
"Arb" came up with the following solution:
File.Delete(String.SplitPath(_DesktopFolder).Drive ..String.SplitPath(_DesktopFolder).Folder.."Cookie s\\abc.txt", false, false, false, nil);
File.Delete(os.getenv("USERPROFILE").."\\Cookies\\ abc.txt", false, false, false, nil);
So ideally, what I would like to do, is to use either "arb's" or "mwreyf1's" solution together with a solution that works on Vista & the older versions of Windows. So essentially, what I need is, 'relative pathways' for the following:
Windows Vista:
C:\Users\<username>\AppData\Roaming\Microsoft\Wind ows\Cookies\abc.txt
C:\Users\<username>\AppData\Roaming\Microsoft\Wind ows\Cookies\Low\abc.txt
C:\Users\<username>\AppData\Roaming\Microsoft\Wind ows\Cookies\Low\abc.txt
Windows 95/98/ME/NT
C:\Windows\Cookies\abc.txt
C:\Windows\Profiles\<username>\Cookies\abc.txt
C:\Windows\Profiles\<username>\Cookies\abc.txt
Comment