Jump to content

Fix for read-only files when copied from CD


Recommended Posts

I'm not sure if this has been discussed or suggested before. I did a quick search and didn't turn up anything.

I've found what you could call a solution to the problem of files being read-only when copied off the CD. Instead of using the commandline to set the file attributes (which i had problems with), you can use WinRAR's Unrar.exe cmdline utility.

I'll provide an example. This is for the RunOnceEx method, but could probably be adapted for the batch file method.

First, get WinRAR installed then navigate to its folder. Copy the 'Unrar.exe' file to '$OEM$\$$\System32' - this will ensure that you can call it from anywhere during the setup.

In this example I'll use mIRC. Create a RAR file (not zip!) in your 'install' folder called 'mirc.rar'.

Next, open your RunOnceEx.cmd file and add:

REG ADD %KEY%\014 /VE /D "mIRC" /f

REG ADD %KEY%\014 /V 1 /D "unrar.exe x %systemdrive%\install\mirc C:\PROGRA~1" /f

This will unrar mirc.rar to 'C:\Program Files\mIRC'. You can change where stuff is extracted to by simply altering 'C:\PROGRA~1'.

You could also use different commandline switches if required.

I've tested this and it works.

Anyway, hope this helps!

Link to comment
Share on other sites


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