You're viewing a comment by gm and its responses.

December 02, 2010, 13:39

I cringe when I see your code... My eyes hurt!

Stop the C:\Users\%USERNAME%\AppData\Local nonsense, you cannot assume anyone has the same directory structure. Localized (non-English) Windows versions, different Windows versions (care to see your code blow up on XP?), all of these make your code unportable.

If you change every C:\Users\%USERNAME%\AppData\Local instance to %LOCALAPPDATA% then your code will be portable and my eyes will stop bleeding! For instances of C:\Users\%USERNAME%\AppData\Roaming you can use %APPDATA% instead. Typing in SET at the command prompt is your friend...

About the actual content, THANKS! It's always good to know how to erase abosolutely everything from your browsing history.

Comment Responses

jang Permalink
December 02, 2010, 14:23

He can assume because it's his virtual machine, so he controls the OS and the folder location expected. That said I would probably use system states to reset everything, I presume it's more secure because even if the virtual machine is hacked, the vulnerability will stay, but any rogue software is wiped.

December 03, 2010, 22:05

Good tips, thanks!

December 14, 2010, 18:02

"...different Windows versions (care to see your code blow up on XP?), all of these make your code unportable. If you change every C:\Users\%USERNAME%\AppData\Local instance to %LOCALAPPDATA% then your code will be portable and my eyes will stop bleeding!"

No need to be hatin' on Peteris, especially since your %LOCALAPPDATA% suggestion doesn't work in XP by default. That variable was first introduced in Vista, and needs to be added manually in XP for your tip to work:

http://www.winhelponline.com/blog/add-localappdata-environment-variable-in-windows-xp/

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.