»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 09-05-2003, 08:43 AM   #1 (permalink)
Registered User
 
Join Date: Sep 2003
Posts: 2
dibbers is on a distinguished road
Kids How to dleete Temporary Internet Files

I'm attempting to make a program that cleans up the Operating System e.g Delete Temp Files, History, Network History and Temporary Internet Files.


My Main Problem is that i can view Temp Internet Files with FindFirst,FindNext but cannot delete them, keep getting an error message

The only way i can think of actually deleteing them is using Wininet.DLL but cannot find any info on the functions and their specifications, OR possibly there is another way to delete the files

I have also tried standard FileListBoxes but have the same problem using "Delete" and DeleteFile - from file mangement rountines.


What is the way to do this.



Also I have a user profile that i cannot access (as some people that use the program may not have ADMIN access rights) but everytime the File search reaches this directory everything goes wrong and doesn;t completely search the rest of the profiles dir and goes to a random Folder - WHICH could cause harm if deleting all files with any extension.
I have put as many checks in as i can (i.e If(DirExists()) ) but cannot find a way to see if the ser using the program can be tested to see if they have rights to the actually directory, as with FILES (which can be done reasonably easyily)

dibbers is offline   Reply With Quote
Old 09-05-2003, 10:03 AM   #2 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
have you tried deleting the folders that are in the temp inet folder?

You have to remember that folder is a special folder in windows. I believe there are usually 4 folders inside that folder.. try deleting them instead... unless you're looking for specific files.

If you're on a box with NTFS (hence the permissions problems) you can look into plugging into ADSI to check NTFS permissions for that user before plunging into the directory.

Hmmm is this on a AD domain?
I'm thinkin the ADSI objects have to be installed on a normal box.
I use it on our domain, but I run the script from the server so I don't have to worry about the client.

Welcome to TechIMO
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 09-05-2003, 10:34 AM   #3 (permalink)
Registered User
 
Join Date: Sep 2003
Posts: 2
dibbers is on a distinguished road
I have tried deleting folders - well at first
Then though it might have to be done the DOS way, delete all files in the folder and then the folder itself - which I have tried with the FindFirst,FindNext - and also the FileListBox and DirListBox - but i just won't work.

What is plugging into ADSI to check NTFS permissions for that user before plunging into the directory - AND how do I use this as would be very useful.


Can something like Wininet be used to access the Temporary Internet Files,
as I think that when go into Interent explorer and clean temporary Interent File Within Tools - Internet Options - Delete Files - the Wininet is used in some way.

Surely the way IE does it can be used - just finding the right library I suppose.

Remember I'm new'ish to programming have only done one 7month course in Borland C++.
dibbers is offline   Reply With Quote
Old 09-05-2003, 11:38 AM   #4 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
You'll have to read to use ADSI .. I can't help with C++ (didn't even realize it was in the C/C++ forum )
http://msdn.microsoft.com/library/en...evelopment.asp

Here's how to do it in VB, maybe you can look around and get an idea from this code
http://www.codeguru.com/mfc/comments/42782.shtml

C++ method...
http://www.experts-exchange.com/Prog..._20587663.html

www.google.com is an amazing thing
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 11-05-2003, 01:20 PM   #5 (permalink)
Registered User
 
Join Date: Oct 2001
Location: New Hampshire, USA
Posts: 604
ctaylor is on a distinguished road
You could always use a shell function to call a batch file to delete files. It's not pure C++ but it will work.

Here is sample code for a DOS batch file on Win XP.

DEL "C:\Documents and Settings\[USERNAME]\Cookies\*.*" /Q

DEL "C:\Documents and Settings\[USERNAME]\Local Settings\History\*.*" /Q /S

DEL "C:\Documents and Settings\[USERNAME]\Local Settings\Temporary Internet Files\*.*" /Q /S
ctaylor is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 10:42 PM.