Question : Script for clearing out Outlook temp folder

I am currently attempting to write a script to use for clearing out the Outlook temp folder that gets filled up and prevents you from opening attachments. I believe I am on the right track but ran into an error when testing my script.

for /f "tokens=3 delims= " %%a in ('reg query hkey_current_user\software\microsoft\office\11.0\outlook\security /v outlooksecuretempfolder') do rd "%%a" /q /ss

%%a was unexpected at this time.

Any help would be appreciated! Thanks!

Answer : Script for clearing out Outlook temp folder

Are you running above statement from command line? %% in for loop are used when you use for loop in batch file. For command line you need to use singe % sign.
Like:

1:
for /f "tokens=3 delims= " %a in ('reg query hkey_current_user\software\microsoft\office\11.0\outlook\security /v outlooksecuretempfolder') do rd "%a" /q /ss
Random Solutions  
 
programming4us programming4us