bsharath
asked on
Remotely clear temp folders
Hi,
I need to clear the temp folders in the file (machine names in the file )
C:\Documents and Settings\User name\Local Settings\Temporary Internet Files\Content.IE5\WHYBKXM7 \sina[1].h tm"
I want to delete any folder in the temporary internet files.
I want to do this remotely on a bulk no of machines.
Regards
Sharath
I need to clear the temp folders in the file (machine names in the file )
C:\Documents and Settings\User name\Local Settings\Temporary Internet Files\Content.IE5\WHYBKXM7
I want to delete any folder in the temporary internet files.
I want to do this remotely on a bulk no of machines.
Regards
Sharath
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ok it was worth a try - I'll have to leave it to the scripting gurus
Hi Sharath
Please try this. May take some time that it will check for every username listed in users.txt in every machine.
for /f %x in (c:\computers.txt) do for /f %y in (c:\users.txt) do del "\\%x\c$\docume~1\%y\local s~1\tempor ~1\*.*" /f /q
Regards
Please try this. May take some time that it will check for every username listed in users.txt in every machine.
for /f %x in (c:\computers.txt) do for /f %y in (c:\users.txt) do del "\\%x\c$\docume~1\%y\local
Regards
ASKER
I get this
C:\>for /f %x in (c:\computers.txt) do for /f %y in (c:\users.txt) do del "\\%x\
c$\docume~1\%y\locals~1\te mpor~1\*.* " /f /q
C:\>for /F %y in (c:\users.txt) do del "\\Dev-chen-mrd100\c$\docu me~1\%y\lo cals~
1\tempor~1\*.*" /f /q
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\***** \locals~1\ tempor~1\* .*" /f /q
The filename, directory name, or volume label syntax is incorrect.
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Admin istrator\l ocals~1\te mpor~1\*.* " /f /
q
Could Not Find \\Dev-chen-mrd100\c$\docum e~1\Admini strator\lo cals~1\tem por~1\*.*
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\admin istrator.D EVELOPMENT \locals~1\ tempor
~1\*.*" /f /q
Could Not Find \\Dev-chen-mrd100\c$\docum e~1\admini strator.DE VELOPMENT\ locals~1\
tempor~1\*.*
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\All\l ocals~1\te mpor~1\*.* " /f /q
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Defau lt\locals~ 1\tempor~1 \*.*" /f /q
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Local Service\lo cals~1\tem por~1\*.*" /f /q
Could Not Find \\Dev-chen-mrd100\c$\docum e~1\LocalS ervice\loc als~1\temp or~1\*.*
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Netwo rkService\ locals~1\t empor~1\*. *" /f
/q
Could Not Find \\Dev-chen-mrd100\c$\docum e~1\Networ kService\l ocals~1\te mpor~1\*.
*
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\shara thr\locals ~1\tempor~ 1\*.*" /f /q
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\***** \locals~1\ tempor~1\* .*" /f /q
The filename, directory name, or volume label syntax is incorrect.
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Admin istrator\l ocals~1\te mpor~1\*.* " /f /
q
Could Not Find \\Dev-chen-mrd100\c$\docum e~1\Admini strator\lo cals~1\tem por~1\*.*
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Admin istrator.D EVELOPMENT \locals~1\ tempor
~1\*.*" /f /q
Could Not Find \\Dev-chen-mrd100\c$\docum e~1\Admini strator.DE VELOPMENT\ locals~1\
tempor~1\*.*
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\ADMIN I~1~DEV\lo cals~1\tem por~1\*.*" /f /q
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\All\l ocals~1\te mpor~1\*.* " /f /q
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Defau lt\locals~ 1\tempor~1 \*.*" /f /q
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Local Service\lo cals~1\tem por~1\*.*" /f /q
Could Not Find \\Dev-chen-mrd100\c$\docum e~1\LocalS ervice\loc als~1\temp or~1\*.*
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\Netwo rkService\ locals~1\t empor~1\*. *" /f
/q
Could Not Find \\Dev-chen-mrd100\c$\docum e~1\Networ kService\l ocals~1\te mpor~1\*.
*
C:\>del "\\Dev-chen-mrd100\c$\docu me~1\shara thr\locals ~1\tempor~ 1\*.*" /f /q
C:\>for /F %y in (c:\users.txt) do del "\\Indiasophos\c$\docume~1 \%y\locals ~1\te
mpor~1\*.*" /f /q
C:\>del "\\Indiasophos\c$\docume~1 \*****\loc als~1\temp or~1\*.*" /f /q
The filename, directory name, or volume label syntax is incorrect.
C:\>del "\\Indiasophos\c$\docume~1 \Administr ator\local s~1\tempor ~1\*.*" /f /q
Could Not Find \\Indiasophos\c$\docume~1\ Administra tor\locals ~1\tempor~ 1\*.*
C:\>del "\\Indiasophos\c$\docume~1 \administr ator.DEVEL OPMENT\loc als~1\temp or~1\*
.*" /f /q
C:\>del "\\Indiasophos\c$\docume~1 \All\local s~1\tempor ~1\*.*" /f /q
The system cannot find the path specified.
C:\>del "\\Indiasophos\c$\docume~1 \Default\l ocals~1\te mpor~1\*.* " /f /q
The system cannot find the path specified.
C:\>del "\\Indiasophos\c$\docume~1 \LocalServ ice\locals ~1\tempor~ 1\*.*" /f /q
Could Not Find \\Indiasophos\c$\docume~1\ LocalServi ce\locals~ 1\tempor~1 \*.*
C:\>del "\\Indiasophos\c$\docume~1 \NetworkSe rvice\loca ls~1\tempo r~1\*.*" /f /q
Could Not Find \\Indiasophos\c$\docume~1\ NetworkSer vice\local s~1\tempor ~1\*.*
C:\>del "\\Indiasophos\c$\docume~1 \sharathr\ locals~1\t empor~1\*. *" /f /q
Could Not Find \\Indiasophos\c$\docume~1\ sharathr\l ocals~1\te mpor~1\*.*
C:\>del "\\Indiasophos\c$\docume~1 \*****\loc als~1\temp or~1\*.*" /f /q
The filename, directory name, or volume label syntax is incorrect.
C:\>del "\\Indiasophos\c$\docume~1 \Administr ator\local s~1\tempor ~1\*.*" /f /q
Could Not Find \\Indiasophos\c$\docume~1\ Administra tor\locals ~1\tempor~ 1\*.*
C:\>del "\\Indiasophos\c$\docume~1 \Administr ator.DEVEL OPMENT\loc als~1\temp or~1\*
.*" /f /q
C:\>del "\\Indiasophos\c$\docume~1 \ADMINI~1~ DEV\locals ~1\tempor~ 1\*.*" /f /q
The system cannot find the file specified.
C:\>del "\\Indiasophos\c$\docume~1 \All\local s~1\tempor ~1\*.*" /f /q
The system cannot find the path specified.
C:\>del "\\Indiasophos\c$\docume~1 \Default\l ocals~1\te mpor~1\*.* " /f /q
The system cannot find the path specified.
C:\>del "\\Indiasophos\c$\docume~1 \LocalServ ice\locals ~1\tempor~ 1\*.*" /f /q
Could Not Find \\Indiasophos\c$\docume~1\ LocalServi ce\locals~ 1\tempor~1 \*.*
C:\>del "\\Indiasophos\c$\docume~1 \NetworkSe rvice\loca ls~1\tempo r~1\*.*" /f /q
Could Not Find \\Indiasophos\c$\docume~1\ NetworkSer vice\local s~1\tempor ~1\*.*
C:\>del "\\Indiasophos\c$\docume~1 \sharathr\ locals~1\t empor~1\*. *" /f /q
Could Not Find \\Indiasophos\c$\docume~1\ sharathr\l ocals~1\te mpor~1\*.*
C:\>
C:\>for /f %x in (c:\computers.txt) do for /f %y in (c:\users.txt) do del "\\%x\
c$\docume~1\%y\locals~1\te
C:\>for /F %y in (c:\users.txt) do del "\\Dev-chen-mrd100\c$\docu
1\tempor~1\*.*" /f /q
C:\>del "\\Dev-chen-mrd100\c$\docu
The filename, directory name, or volume label syntax is incorrect.
C:\>del "\\Dev-chen-mrd100\c$\docu
q
Could Not Find \\Dev-chen-mrd100\c$\docum
C:\>del "\\Dev-chen-mrd100\c$\docu
~1\*.*" /f /q
Could Not Find \\Dev-chen-mrd100\c$\docum
tempor~1\*.*
C:\>del "\\Dev-chen-mrd100\c$\docu
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu
Could Not Find \\Dev-chen-mrd100\c$\docum
C:\>del "\\Dev-chen-mrd100\c$\docu
/q
Could Not Find \\Dev-chen-mrd100\c$\docum
*
C:\>del "\\Dev-chen-mrd100\c$\docu
C:\>del "\\Dev-chen-mrd100\c$\docu
The filename, directory name, or volume label syntax is incorrect.
C:\>del "\\Dev-chen-mrd100\c$\docu
q
Could Not Find \\Dev-chen-mrd100\c$\docum
C:\>del "\\Dev-chen-mrd100\c$\docu
~1\*.*" /f /q
Could Not Find \\Dev-chen-mrd100\c$\docum
tempor~1\*.*
C:\>del "\\Dev-chen-mrd100\c$\docu
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu
The system cannot find the path specified.
C:\>del "\\Dev-chen-mrd100\c$\docu
Could Not Find \\Dev-chen-mrd100\c$\docum
C:\>del "\\Dev-chen-mrd100\c$\docu
/q
Could Not Find \\Dev-chen-mrd100\c$\docum
*
C:\>del "\\Dev-chen-mrd100\c$\docu
C:\>for /F %y in (c:\users.txt) do del "\\Indiasophos\c$\docume~1
mpor~1\*.*" /f /q
C:\>del "\\Indiasophos\c$\docume~1
The filename, directory name, or volume label syntax is incorrect.
C:\>del "\\Indiasophos\c$\docume~1
Could Not Find \\Indiasophos\c$\docume~1\
C:\>del "\\Indiasophos\c$\docume~1
.*" /f /q
C:\>del "\\Indiasophos\c$\docume~1
The system cannot find the path specified.
C:\>del "\\Indiasophos\c$\docume~1
The system cannot find the path specified.
C:\>del "\\Indiasophos\c$\docume~1
Could Not Find \\Indiasophos\c$\docume~1\
C:\>del "\\Indiasophos\c$\docume~1
Could Not Find \\Indiasophos\c$\docume~1\
C:\>del "\\Indiasophos\c$\docume~1
Could Not Find \\Indiasophos\c$\docume~1\
C:\>del "\\Indiasophos\c$\docume~1
The filename, directory name, or volume label syntax is incorrect.
C:\>del "\\Indiasophos\c$\docume~1
Could Not Find \\Indiasophos\c$\docume~1\
C:\>del "\\Indiasophos\c$\docume~1
.*" /f /q
C:\>del "\\Indiasophos\c$\docume~1
The system cannot find the file specified.
C:\>del "\\Indiasophos\c$\docume~1
The system cannot find the path specified.
C:\>del "\\Indiasophos\c$\docume~1
The system cannot find the path specified.
C:\>del "\\Indiasophos\c$\docume~1
Could Not Find \\Indiasophos\c$\docume~1\
C:\>del "\\Indiasophos\c$\docume~1
Could Not Find \\Indiasophos\c$\docume~1\
C:\>del "\\Indiasophos\c$\docume~1
Could Not Find \\Indiasophos\c$\docume~1\
C:\>
Hi Sharath
Maybe specified users do not exist under documents and settings. Would you please try browsing \\Indiasophos\c$\docume~1\ sharathr from start>Run . Check if it exists.
Regards
Maybe specified users do not exist under documents and settings. Would you please try browsing \\Indiasophos\c$\docume~1\
Regards
ASKER
Yes there is a user called sharathr
Hi Sharath
What happened when you browsed \\Indiasophos\c$\docume~1\ sharathr ?
Regards
What happened when you browsed \\Indiasophos\c$\docume~1\
Regards
ASKER
I am able to see desktop,cookies,favorites all the folders
Hi Sharath
It looks like the following line worked
C:\>del "\\Indiasophos\c$\docume~1 \Administr ator.DEVEL OPMENT\loc als~1\temp or~1\*
.*" /f /q
Would you please check if temps are really deleted under administrator.development? If yes, there may be permission related issues in other profiles.
Regards
It looks like the following line worked
C:\>del "\\Indiasophos\c$\docume~1
.*" /f /q
Would you please check if temps are really deleted under administrator.development?
Regards
ASKER
I checked the temp files were deleted but not in all profiles.
Any other method from which we can delete all the temp folders in all profiles.
Any other method from which we can delete all the temp folders in all profiles.
Hi Sharath
In profile folder of some users, Temporary Internet Files may not exist. That may be the reason why it fails in some users. For example check the \\Indiasophos\c$\docume~1\ sharathr location, double-click local settings and check if "temproray internet files" folder exist.
Regards
In profile folder of some users, Temporary Internet Files may not exist. That may be the reason why it fails in some users. For example check the \\Indiasophos\c$\docume~1\
Regards
ASKER
I checked there is a folder
\\indiasophos\c$\docume~1\ sharathr\L ocal Settings\Temporary Internet Files
\\indiasophos\c$\docume~1\
Hi Sharath
Would you please type the following alone in cmd?
del \\indiasophos\c$\docume~1\ sharathr\L ocal Settings\Temporary Internet Files\*.*
and this
del \\indiasophos\c$\docume~1\ sharathr\L ocals~1\Te mpor~1\*.*
Regards
Would you please type the following alone in cmd?
del \\indiasophos\c$\docume~1\
and this
del \\indiasophos\c$\docume~1\
Regards
ASKER
I am able to browse like this
\\indiasophos\c$\docume~1\ sharathr\L ocal Settings\Temporary Internet Files
I get this.
C:\>del \\indiasophos\c$\docume~1\ sharathr\L ocal Settings\Temporary Internet Files\*.*
The system cannot find the file specified.
\\indiasophos\c$\docume~1\
I get this.
C:\>del \\indiasophos\c$\docume~1\
The system cannot find the file specified.
How about the following?
del \\indiasophos\c$\docume~1\ sharathr\L ocals~1\Te mpor~1\*.*
or this one
del \\indiasophos\c$\docume~1\ sharat~1\L ocals~1\Te mpor~1\*.*
Regards
del \\indiasophos\c$\docume~1\
or this one
del \\indiasophos\c$\docume~1\
Regards
ASKER
C:\>del \\indiasophos\c$\docume~1\
Could Not Find \\indiasophos\c$\docume~1\
C:\>del \\indiasophos\c$\docume~1\
The system cannot find the path specified.
Hi Sharath
Maybe Temproray internet files folder is empty?
Regards
Maybe Temproray internet files folder is empty?
Regards
ASKER
There is a folder called
Content.IE5
Content.IE5
ASKER
Sorry i checked by creating some files and some folders.All the files are being deleted but not the folders.Can you give me to delete folders too.
Hi Sharath
Sorry, my mistake. Please add /s switch as below and modify the script.
del \\indiasophos\c$\docume~1\ sharathr\L ocals~1\Te mpor~1\*.* /f /s /q
Regards
Sorry, my mistake. Please add /s switch as below and modify the script.
del \\indiasophos\c$\docume~1\
Regards
ASKER
Thanks this worked.
can you give me a total script.
Machine names should be taken from file.Autmatically it need to clear all the temp folders in all profiles.
can you give me a total script.
Machine names should be taken from file.Autmatically it need to clear all the temp folders in all profiles.
Hi Sharath
Sure
for /f %x in (c:\computers.txt) do for /f %y in (c:\users.txt) do del "\\%x\c$\docume~1\%y\local s~1\tempor ~1\*.*" /f /s /q
Regards
Sure
for /f %x in (c:\computers.txt) do for /f %y in (c:\users.txt) do del "\\%x\c$\docume~1\%y\local
Regards
ASKER
In users.txt what should be there in it?
Hi Sharath
There should be the list of all username profile folders.
need to clear the temp folders in the file (machine names in the file )
C:\Documents and Settings\User name\Local Settings\Temporary Internet Files\Content.IE5\WHYBKXM7 \sina[1].h tm" ↑
It may prompt "The system cannot find the path specified", just ignore them because all user profiles do not exist in computer. If profile in username.txt exist in the computer, temps in it will be deleted. If not it will prompt cannot find path specified. Ignore it.
Regards
There should be the list of all username profile folders.
need to clear the temp folders in the file (machine names in the file )
C:\Documents and Settings\User name\Local Settings\Temporary Internet Files\Content.IE5\WHYBKXM7
It may prompt "The system cannot find the path specified", just ignore them because all user profiles do not exist in computer. If profile in username.txt exist in the computer, temps in it will be deleted. If not it will prompt cannot find path specified. Ignore it.
Regards
ASKER
FILES ARE NOT GETTING DELETED IN ALL PROFILES
C:\Documents and Settings\administrator.DEV ELOPMENT\L ocal Settings\Temporary Internet Files
iN THE ABOVE PROFILE THERE ARE 100'S OF FILES
C:\Documents and Settings\administrator.DEV
iN THE ABOVE PROFILE THERE ARE 100'S OF FILES
Hi Sharath
You mention c:\. You should add this computers name to computers.txt too. And please write me the error message when it can not delete in this profile. May be an access permission issue.
Regards
You mention c:\. You should add this computers name to computers.txt too. And please write me the error message when it can not delete in this profile. May be an access permission issue.
Regards
ASKER
I get this
C:\>for /F %y in (c:\users.txt) do del "\\dev-chen-srv400\c$\docu me~1\%y\lo cals~
1\tempor~1\*.*" /f /s /q
The system cannot find the file c:\users.txt.
C:\>for /F %y in (c:\users.txt) do del "\\dev-chen-srv400\c$\docu
1\tempor~1\*.*" /f /s /q
The system cannot find the file c:\users.txt.
ASKER
I have 6 profiles in this machine
I think all are getting cleared excluding this 1 profile.This is the Domain Administrator login.
C:\Documents and Settings\administrator.DEV ELOPMENT\L ocal Settings\Temporary Internet Files
can we remove the users.txt
I think all are getting cleared excluding this 1 profile.This is the Domain Administrator login.
C:\Documents and Settings\administrator.DEV
can we remove the users.txt
Hi Sharath
Please create a users.txt in c:\ and write profile folder names like
admini~1
sharathr
We can not remove users.txt because Temps are not in a general path like program files.
Regards
Please create a users.txt in c:\ and write profile folder names like
admini~1
sharathr
We can not remove users.txt because Temps are not in a general path like program files.
Regards
ASKER
Shouls all the users names be in the users.txt or just some users
Hi Sharath
The users profile folders of computers which are in computers.txt, should be in that users.txt.
Regards
The users profile folders of computers which are in computers.txt, should be in that users.txt.
Regards
ASKER
That would be difficult Mrhusy.
I need to first find all machines and then the user profiles in it.It would be difficult to get all 1000+ machine details as such.
Any other alternative solution for this.
I need to first find all machines and then the user profiles in it.It would be difficult to get all 1000+ machine details as such.
Any other alternative solution for this.
Hi Sharath
Hmm, here is an other way.
Create a batch file named clear.bat and write following in it
del c:\docume~1\%username%\Loc al Settings\Temporary Internet Files\*.* /f /s /q
Then run the following
for /f x in (c:\computers.txt) do psexec \\%x -c c:\clear.bat -f
Regards
Hmm, here is an other way.
Create a batch file named clear.bat and write following in it
del c:\docume~1\%username%\Loc
Then run the following
for /f x in (c:\computers.txt) do psexec \\%x -c c:\clear.bat -f
Regards
ASKER
i get this
C:\Pstool>for /f x in (c:\computers.txt) do psexec \\%% -c c:\clear.bat -f
in was unexpected at this time.
C:\Pstool>for /f x in (c:\computers.txt) do psexec \\%% -c c:\clear.bat -f
in was unexpected at this time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get this.
C:\>psexec \\dev-chen-pc100 -c c:\clear.bat -f
PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
C:\Windows\system32>del c:\docume~1\DEV-CHEN-PC100 $\Local Settings\Temporary Int
ernet Files\*.* /f /s /q
The system cannot find the file specified.
clear.bat exited on dev-chen-pc100 with error code 1.
I have tried the same in many machines.
C:\>psexec \\dev-chen-pc100 -c c:\clear.bat -f
PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
C:\Windows\system32>del c:\docume~1\DEV-CHEN-PC100
ernet Files\*.* /f /s /q
The system cannot find the file specified.
clear.bat exited on dev-chen-pc100 with error code 1.
I have tried the same in many machines.
ASKER
I think the name is missing sharathr
C:\Documents and Settings\sharathr\Local Settings\Temporary Internet Files
C:\Documents and Settings\sharathr\Local Settings\Temporary Internet Files
ASKER
Any help
ASKER
Any help on this......
Thank you for accepting Sharath, i wish I could help better
ASKER