Jump to content

Recommended Posts

Posted

Hi everybody!

I came up with the following script to fix the $OEM$ folders read only flaw. It marks all read only files not read only recursively.

dir %1 /AR /B /S >%2
FOR /F "tokens=* " %%I IN (%2) DO attrib -R "%%I" /S /D
del %2

Also added it for your downloading pleasure... :)

Usage:

readonly[.cmd] "c:\path\to\dir" c:\mytempfile.txt

Note: this also supports environment variables.

Have fun! :) And please feel free to post modifications here.

ProClub

readonly.cmd


Posted

How about a single line

FOR /F "DELIMS=*" %%? IN ('DIR/B/S/AR "%~1"^2^>NUL') DO IF ERRORLEVEL 0 ATTRIB -R "%%?" /S /D

Usage:

readonly[.cmd] "x:\path to\dir"

quotes only if spaces in path or file name

Posted (edited)

As far as that's concerned, we might have a littttle problem. RunOnceEx seems to run under some weird no-user-right so the attrib command has no effect. Trying out cmdlines.txt right now.

Edited by ProClub
Posted

Yep, cmdlines.txt as well. This really sucks.

Why would I do this? Because I like to copy a Firefox and Thunderbird defaul profile via $oem$ to the Default User profile so that that profile is applied to every user. Now, since Windows keeps keeping those flags, Firefox gets reeeally cranky and buggy. So, guess what, reset the read only flag.

However, if I can't do it anyhow from setup, I'd have to do it manually at which point I'm as good as installing Windows myself.

Posted

Sode debuging added up the following:

- Seems I was wrong, you do have the rights to modify the read only flag at install time, hovever

- there was a problem with my script calling readonly.cmd. I'm right now doing a test with it. If my script is ready, I'll post it here.

Posted

I put the following in my Cleanup.cmd file to change the attributes...

REM :: Fix $OEM$\$Progs Entries ::
ATTRIB -R "%ProgramFiles%\Rainlendar\*.*" /S /D
ATTRIB -R "%ProgramFiles%\Winamp\Skins\AR7\*.*" /S /D
ATTRIB -R "%ProgramFiles%\WallpaperToy\*.*" /S /D
ATTRIB -R "%ProgramFiles%\WinZip\*.*" /S /D
ATTRIB -R "%ProgramFiles%\WinRAR\*.*" /S /D

Posted (edited)

For the programs I have listed (Rainlendar, Winamp Skin, Winzip, WinRAR, etc), I need to get rid of the Read Only attribute in order to be able to change any settings.

For example, in Rainlendar, you can't change the skin or it's position on the desktop without getting rid of the Read Only Attribute. When you reboot, it will go back to the original skin, and original location on the desktop.

Edited by Powerhouse

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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