PROBLEMCHYLD Posted May 18, 2012 Posted May 18, 2012 (edited) I know nothing about batch files. I tried to put together this script, and not sure why things isn't working.attrib.exe -h %windir%\shelli~1del %windir%\shelli~1attrib.exe -h %windir%\ttfcachedel %windir%\ttfcacheif not exist %windir%\inf\tweakui.inf del %windir%\system\tweakui.cplRUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\Program Files\Common Files\Microsoft Shared\ReplmanRUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\Program Files\Common Files\System\Comp Edited May 21, 2012 by PROBLEMCHYLD
dencorso Posted May 18, 2012 Posted May 18, 2012 I know nothing about batch files. I tried to put together this script, and not sure why things isn't working.One possibility is that you might have to use double quotes around the path/filename containing spaces... Do give my modified version below a try and report.attrib.exe -h %windir%\shelli~1del %windir%\shelli~1attrib.exe -h %windir%\ttfcachedel %windir%\ttfcacheif not exist %windir%\inf\tweakui.inf del %windir%\system\tweakui.cplRUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\"Program Files\Common Files\Microsoft Shared\Replman"RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\"Program Files\Common Files\System\Comp"
Geej Posted May 18, 2012 Posted May 18, 2012 (edited) PROBLEMCHYLD, it would be more useful if you were to indicate which line is giving you problem and what os it is running on.Off my head, shelli~1 and ttfcache looks like folder. Perhaps you could replace del with rd.%24% is use by inf, not sure if cmd shell will parse the variable correctly if run via batch.Try replace with %systemdrive% (better still, change the entire rundll.exe ... to rd /q ...)If path contain space, double quote it Edited May 18, 2012 by Geej
PROBLEMCHYLD Posted May 18, 2012 Author Posted May 18, 2012 One possibility is that you might have to use double quotes around the path/filename containing spaces... Do give my modified version below a try and report.I'll give it a shot. ThanksOff my head, shelli~1 and ttfcache looks like folder.They are actually files.
jaclaz Posted May 21, 2012 Posted May 21, 2012 (edited) For the record, I just got confirmation that the issue was this one:http://ss64.com/nt/attrib.htmlHidden and System attributes take priority. If a file has both the Hidden and System attributes set, you can clear both attributes only with a single ATTRIB command. For example, to clear the Hidden and System attributes for the RECORD.TXT file, you would type: ATTRIB -S -H RECORD.TXT(suggested to OP via PM as something to try and now reported as having solved the issue)jaclaz Edited May 21, 2012 by jaclaz
Yzöwl Posted May 21, 2012 Posted May 21, 2012 Changing the attributes shouldn't be necessary when deleting files. The first four lines given could have been replaced with the following single line:DEL /A "%WINDIR%\SHELLI~1" "%WINDIR%\TTFCACHE"Also have you considered the DELTREE command?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now