Corflags error cf001 could not open file for writing

Customer is trying to use 'corflags.exe' to modify a Controller executable (for example to solve problem in separate Technote 1508588). An error appears.

Problem

Customer is trying to use ‘corflags.exe’ to modify a Controller executable (for example to solve problem in separate Technote 1508588). An error appears.

Symptom

corflags : error CF001 : Could not open file for writing

Cause

The operating system cannot modify the EXE file.

There are several possible causes for this:

  • Scenario #1 — Windows user running the command prompt does not have NTFS write access to the file
  • Scenario #2 — EXE file has the «read only» file flag ticked
  • Scenario #3 — Someone has got the EXE file (for example the program is running in Windows)

Resolving The Problem

The solution varies depending on the cause:

  • Scenario #1 — Modify NTFS permission, or launch Command Prompt as a different (administrative) user
  • Scenario #2 — Right-click on the file, click «properties» and untick «read only» attribute.
  • Scenario #3 — Close the EXE file (currently running in Windows).

Related Information

[{«Product»:{«code»:»SS9S6B»,»label»:»IBM Cognos Controller»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Controller»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»10.1″,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

You are close

«C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6 Tools/CorFlags.exe» /32bit+ «C:/Steam/steamapps/common/Skyrim/PapyrusCompiler/PapyrusCompiler.exe»

There has to be a space between the corflags.exe and the /32bit+ which is a flag.

Alternately in a window cmd shell try

cd  «C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6 Tools/» 

coreflags.exe 32bit+ <file>

where in your case

coreflags.exe /32bit+ «C:/Steam/steamapps/common/Skyrim/PapyrusCompiler/PapyrusCompiler.exe»

You could also search for corflags.exe on your C drive. This should turn up a copy or three.

Sorry the last post contained two items jumbled togther. 

For the first one you gave me, it made progress. Corflags comes up in cmd prompt, however, /32bit+ isn’t an option. Available options are…

/ILONLY+ /ILONLY-           Sets/clears the ILONLY flag

/32BITREQ+ /32BITREQ-   Sets/clears the bits indicating 32-bit x86 only

/32BITPREF+ /32BITPREF- Sets/clears the bits indicating 32-bit preferred

/UpgradeCLRHeader          Upgrade the CLR Header to version 2.5

/RevertCLRHeader             Revert the CLR Header to version 2.0

/Force                              Force an assembly update even if the image is

                                       strong name signed.

                                       WARNING: Updating a strong name signed assembly

                                       will require the assembly to be resigned before

                                       it will execute properly.

/nologo                            Prevents corflags from displaying logo

I would try the others you recommended as well, but I don’t know what a window command shell is. =/


Edited September 17, 2015 by Toosdey

Я пытаюсь отредактировать файл corflags, чтобы запускать 32-разрядные приложения на 64-разрядном компьютере, но каждый раз, когда я пытаюсь отредактировать файл, используя что-то вроде corflags.exe assembly /32bit+, появляется сообщение об ошибке cf001 could not open file for writing.

Теперь я пробовал много разных вариантов, таких как:

  • Запуск в режиме администратора;
  • Поиск файла с помощью поиска и проверка только для чтения не отмечены галочкой
  • Проверка того, что полный доступ пользователя отмечен галочкой
  • Пытался сделать всю папку не только для чтения

При проверке всей папки она выглядит так, как будто она установлена ​​только для чтения, но затем я нажимаю «ОК» и повторно щелкаю правой кнопкой мыши по всей папке, поле заполняется (не ставится галочка). Означает ли это, что часть папки только для чтения и почему она сбрасывается только для чтения?

3 ответа

Создайте копию файла, который вы хотите настроить с помощью CorFlags. (например, «WcfServiceHost.exe» —creates—> «WcfServiceHost — Copy.exe»)

Переименуйте исходный файл во что-то другое: (например, «WcfServiceHost.exe» —> «WcfServiceHose_Original.exe»)

Переименуйте, чтобы скопировать исходное имя файла (например, «WcfServiceHose — Copy.exe» —> «WcfServiceHost.exe»

Для своих целей я создал копии и назвал их, описывая их конфигурацию: Пример: WCFServiceHost_With32BitOn.exe WCFServiceHost_With32BitOff.exe

Теперь я могу уничтожить файлы WCFServiceHost.exe и создать их из этих предварительно модифицированных копий. Больше никаких операций CorFlags не требуется.

Примечание: в основном это более подробная версия ответа @RMalke, и этот ответ должен быть помечен как ответ.


0

daviesdoesit
15 Дек 2016 в 18:10

Я понимаю, что это годы спустя, но для всех, кто ищет, я обнаружил, что самым быстрым способом было скопировать cmd и corflags.exe в ту же папку, что и та, которую вы хотите отредактировать. Затем запустите cmd от имени администратора оттуда.


-2

Tsyvarev
9 Сен 2015 в 15:43

Я только что столкнулся с той же проблемой и пробовал то же самое.

Запустите cornflags с повышенными правами («Запуск от имени администратора») Visual Studio Command Prompt. Я сделал то же самое для копии оригинального .exe, просто чтобы убедиться, что никакой другой процесс не использует программу.


2

RMalke
6 Сен 2019 в 16:44

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Coremediaerrordomain ошибка пишет на айфоне
  • Corellaser ошибка при запуске ver 11
  • Coreleasemarshaldata stdmarshal releasemarshaldata failed with error 0x8001011d
  • Cool reader error occurred while reading opds catalog
  • Cool edit pro output device error

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии