batch file to open OLK folder in Windows!

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Synblade
Posts: 2
Joined: 11 Apr 2007 12:07

batch file to open OLK folder in Windows!

#1 Post by Synblade » 11 Apr 2007 12:15

Hello, short background here:

When opening an attachment in Outlook, then modifying it and clicking Save instead of Save As, Outlook will save the file in a directory in the temporary internet files folder. This directory is a hidden directory and it is randomly generated on each computer, and it's hard to find.

There is a way to find the folder by going to the registry key

Outlook 2003 HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security
Outlook 2007 HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security

And it will display it, for example
"C:\\Documents and Settings\\XXXXXXX\\Local Settings\\Temporary Internet Files\\OLK20A\\"

I wrote a simple batch file to export that data into a text file on the desktop called olk.txt --

regedit /e "%USERPROFILE%\Desktop\olk.txt" "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security"
pause

Here is what the text file looks like when opened:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security]
"OutlookSecureTempFolder"="C:\\Documents and Settings\\XXXXXXX\\Local Settings\\Temporary Internet Files\\OLK20A\\"
"Level1Remove"="LNK;URL"
"PublishToGalDisabled"=dword:00000001
"EnableRememberPwd"=dword:00000000


What I want to do is to be able to take that path out of that text file somehow and either copy it to the clipboard or open the folder that it's in. Is that possible to do?

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

#2 Post by DosItHelp » 11 Apr 2007 19:55

Synblade,
In order to avoid having to deal with the double \\ in the path and the extra temporary olk.txt file you could use the REG command like this:

Code: Select all

for /f "tokens=2,*" %%a in ('"reg query HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security /v OutlookSecureTempFolder|find "OutlookSecureTempFolder" "') do (
    explorer "%%b"
)



DOS IT HELP?
Last edited by DosItHelp on 13 Apr 2007 21:29, edited 2 times in total.

Synblade
Posts: 2
Joined: 11 Apr 2007 12:07

#3 Post by Synblade » 12 Apr 2007 15:08

That worked perfectly, thank you!

Post Reply