ProClub Posted January 9, 2006 Posted January 9, 2006 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
Yzöwl Posted January 9, 2006 Posted January 9, 2006 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
Powerhouse Posted January 10, 2006 Posted January 10, 2006 Just a quick question....why would I want to do this? And if necessary, where and when would I run this command?
ProClub Posted January 10, 2006 Author Posted January 10, 2006 (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 January 10, 2006 by ProClub
ProClub Posted January 10, 2006 Author Posted January 10, 2006 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.
ProClub Posted January 10, 2006 Author Posted January 10, 2006 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.
Powerhouse Posted January 11, 2006 Posted January 11, 2006 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
BoardBabe Posted January 11, 2006 Posted January 11, 2006 Uhm, yeh why would you wanna do this exactly?
Powerhouse Posted January 11, 2006 Posted January 11, 2006 (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 January 11, 2006 by Powerhouse
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now