Jump to content

Recommended Posts

Posted (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~1
del %windir%\shelli~1
attrib.exe -h %windir%\ttfcache
del %windir%\ttfcache
if not exist %windir%\inf\tweakui.inf del %windir%\system\tweakui.cpl
RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\Program Files\Common Files\Microsoft Shared\Replman
RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\Program Files\Common Files\System\Comp

Edited by PROBLEMCHYLD

Posted

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~1
del %windir%\shelli~1
attrib.exe -h %windir%\ttfcache
del %windir%\ttfcache
if not exist %windir%\inf\tweakui.inf del %windir%\system\tweakui.cpl
RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\"Program Files\Common Files\Microsoft Shared\Replman"
RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\"Program Files\Common Files\System\Comp"

Posted (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 by Geej
Posted

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. Thanks

Off my head, shelli~1 and ttfcache looks like folder.

They are actually files.
Posted (edited)

For the record, I just got confirmation that the issue was this one:

http://ss64.com/nt/attrib.html

Hidden 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 by jaclaz
Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...