January 9, 200620 yr 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 >%2FOR /F "tokens=* " %%I IN (%2) DO attrib -R "%%I" /S /Ddel %2Also added it for your downloading pleasure... Usage:readonly[.cmd] "c:\path\to\dir" c:\mytempfile.txtNote: this also supports environment variables.Have fun! And please feel free to post modifications here.ProClubreadonly.cmd
January 9, 200620 yr How about a single lineFOR /F "DELIMS=*" %%? IN ('DIR/B/S/AR "%~1"^2^>NUL') DO IF ERRORLEVEL 0 ATTRIB -R "%%?" /S /DUsage:readonly[.cmd] "x:\path to\dir"quotes only if spaces in path or file name
January 10, 200620 yr Just a quick question....why would I want to do this? And if necessary, where and when would I run this command?
January 10, 200620 yr Author 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 January 10, 200620 yr by ProClub
January 10, 200620 yr Author 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.
January 10, 200620 yr Author 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.
January 11, 200620 yr I put the following in my Cleanup.cmd file to change the attributes...REM :: Fix $OEM$\$Progs Entries ::ATTRIB -R "%ProgramFiles%\Rainlendar\*.*" /S /DATTRIB -R "%ProgramFiles%\Winamp\Skins\AR7\*.*" /S /DATTRIB -R "%ProgramFiles%\WallpaperToy\*.*" /S /DATTRIB -R "%ProgramFiles%\WinZip\*.*" /S /DATTRIB -R "%ProgramFiles%\WinRAR\*.*" /S /D
January 11, 200620 yr 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 January 11, 200620 yr by Powerhouse
Create an account or sign in to comment