Computing.Net > Forums > Programming > Batch Programming for XP help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch Programming for XP help

Reply to Message Icon

Name: AKL-MFCU
Date: November 5, 2005 at 08:26:03 Pacific
OS: Windows XP
CPU/Ram: 2.8ghz / 1 GB DDR500
Comment:

I'm probabbly one of the least skilled people at writing batch files but I have been practicing making a maintenance batch file for our XP machines at work (all 495 of them) in which I don't have the time to set them up in scheduler normally so I'm using a batch file and an altiris deployment method to set these up. Now, I should have done it before but I did not set up the profiles to delete the temporary internet files while leaving internet explorer. It does clean some, but leaves plenty of cookies/images behind still after even after running cleanmgr.exe .

So heres my problem in writing the batch script:

Alot of the time people are switching to different computers at different locations. This creates a profile and creates the files they use under the documents and settings folder on the C:. I am curerntly stuck at this point in my attempts to clear it:

DEL C:\Documents and Settings\%USERPROFILE%\Local Settings\Temporary Internet Filse\*.* /Q /F

However this only cleans it locally for that particular user when the scheduler runs. I do not want this to happen necessarily daily, but more like monthly just to clear up any excess. If there are 10 different users on that machine and some have not even been accessed for 10 days, how can I have it go into each user folder in the documents and settings and delete the path shown above?

One more quick question- can a vbs script be run through a batch file and wait for the vbs script to finish before continuing with the rest of the script?




Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: November 5, 2005 at 09:08:39 Pacific
Reply:

Try this for the bat:

:: TIFclean.bat
@echo off

:main

pushd "C:\Documents and Settings
for /f "tokens=* delims=" %%U in ('dir /ad /b') do call :deleter %%U
popd
goto :eof

:deleter

del "%*\Local Settings\Temporary Internet Files" /F /Q
:: DONE


If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: AKL-MFCU
Date: November 5, 2005 at 09:56:07 Pacific
Reply:

This works great except for one problem- does not accept anything with a username that comes from a domain: usernamehere.domainnamehere - any way around that?


0

Response Number 3
Name: Mechanix2Go
Date: November 5, 2005 at 10:07:31 Pacific
Reply:

Is the directory:

usernamehere.domainnamehere

actually there?


If at first you don't succeed, you're about average.

M2


0

Response Number 4
Name: AKL-MFCU
Date: November 5, 2005 at 10:09:15 Pacific
Reply:

yes, its one of the folders there and common among several users. for example, akl.mfcu is there and its temporary internet files folder is not being emptied.


0

Response Number 5
Name: Mechanix2Go
Date: November 5, 2005 at 10:20:27 Pacific
Reply:

So you have:

C:\Documents and Settings\usernamehere.domainnamehere\akl.mfcu\Local Settings\Temporary Internet Files

Is that correct?


If at first you don't succeed, you're about average.

M2


0

Related Posts

See More



Response Number 6
Name: AKL-MFCU
Date: November 5, 2005 at 10:29:45 Pacific
Reply:

No, what I mean is I have:
C:\Documents and Settings\akl.mfcu\Local Settings\Temporary Internet Files

And while it deletes the internet files from say:
C:\Documents and Settings\akl\Local Settings\Temporary Internet Files

It does not do it from the domain username as show above. Any thoughts?


0

Response Number 7
Name: AKL-MFCU
Date: November 5, 2005 at 10:42:27 Pacific
Reply:

By the way, you are the man at programming.


0

Response Number 8
Name: Mechanix2Go
Date: November 5, 2005 at 11:06:16 Pacific
Reply:

I just created this:

C:\Documents and Settings\akl.mfcu\Local Settings\Temporary Internet Files


put some files, ran the bat and they got deleted.

Dunno what's wrong.

Do this and post what you get:

cd "C:\Documents and Settings
dir /ad/b


If at first you don't succeed, you're about average.

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch Programming for XP help

Batch programming for loop help www.computing.net/answers/programming/batch-programming-for-loop-help/18116.html

Batch program to process all files in folder www.computing.net/answers/programming/batch-program-to-process-all-files-in-folder/19798.html

Batch Ping, Errorlevel script help www.computing.net/answers/programming/batch-ping-errorlevel-script-help/17331.html