|
-
January 2nd, 2010, 06:05 AM
#1
How to enter a directory with random name?
In Vista, I want my code to create the following data inside a string:
Code:
// string ffpath holds:
"C:\\Users\\$_CurrentUser_$\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\ewg8ep30.default\\"
I need to use the WinAPI code:
Code:
DeleteFile( ffPath + "bookmarks.html" );
As you can see, the last folder name seems to be very randomized (ewg8ep30.default) for each computer and I'm guessing the more firefox profiles one has, the more random folders there will be (lets assume all users using my code will have only one).
What techniques can I use to get that folders name into the string and delete bookmarks.html? "C:\Users\$_CurrentUser_$\AppData\Roaming\Mozilla\Firefox\Profiles\" is already determined but I need to join that last part to create the full path just this one time to delete bookmarks.html.
I was thinking maybe search \Profiles\ for other folders? But im not sure how to do that or if thats a good method.
Maybe theres a way to "skip" the next folder once inside \Profiles\?
Thanks.
Last edited by ASHL33T; January 2nd, 2010 at 06:42 AM.
New to C++ and Visual C++ 2008 Express Edition.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|