Jump to content

Fedit


Recommended Posts

Hi,

I noticed people here and there have started using Fedit. I even got mails asking "am I allowed to use it?". Well the answer is YES! I'm glad this utility helps some people. So I'm now posting it in public.

The latest version of Fedit is 2.0. The size is 122KB, but you can bring that down a lot by using UPX compression and removing the icon (First remove the icon, then UPX). The syntax for using Fedit is:

  -add
     Tells Fedit to add LINE.
  -rem
     Tells Fedit to remove LINE.
  -f "some file"
     The file to be edited
  -l "some text"
     The text to be added or removed

When adding, these are additional (optional) parameters:
  -a[:co] "some text"
     The text will be added after this line
  -b[:co] "some text"
     The text will be added before this line
  -s[:c] "some text"
     The text will be added in the section [some text]
  -once
     The text to be added, will only be added once in the whole file
  -create
     If the section isn't found, it will be created

When removing, -l supports the parameter [:co], and these additional
(optional) parameters:
  -a[:co] "some text"
     All instances of the text after this line will be removed.
  -b[:co] "some text"
     All instances of the text before this line will be removed.
  -s[:c] "some text"
     All instances of the text in section [some text] will be removed.
  -once
     The text to be removed, will only be removed once.

The option [:co] means the following:
If you have a parameter -a "some text", Fedit will automatically search for
strings that match it (without being case sensitive). If you want it to be
case sensitive, change it to this:
  -a:c "some text"
If you think that 'some text' is contained in a bigger string like 'this is
some text written somewhere', then change it to this:
  -a:o "some text"
You can combine both to this:
  -a:co "some text"

IMPORTANT: none of the parameters are case sensitive, so for example -rem is
  the same as -Rem or -REM. Same thing for -a:co or -A:CO
IMPORTANT: the order of the parameters is unimportant, so:
  Fedit -rem -f file -l:co text
Is the same as:
  Fedit -f file -l:oc text -rem

If you have any problems or requests, post here please. There are two attachments: the normal Fedit, and the Fedit without icon and UPX-ed.

Updated 3 August 2005: Totally rewritten fedit, adding many features like before, casesensitive, contained, and less disk access so speed should have increased...

Fedit_with_icon.rar

Fedit_without_icon.rar

Edited by djbe
Link to comment
Share on other sites


Hi,

I cannot thank you enough for releasing this tool (I have been searching for this for ages and ages on the net and in MSFN)....

--> Was trying mind boggling ways to create a DOS utility using GSAR.EXE (Global Search and Replace) to accomplish such a task !!! -- Thank you again....

Oh: and BTW, UPX doesn't work, gives an "UncompressibleFileException"

syntax is: UPX --best -f FEDIT.EXE

-> Makecab the file cuts size down to 42KB so UPX is not working...

Edited by ChipCraze23
Link to comment
Share on other sites

I'm sorry, totally forgot about that. You have to remove the icon before compressing Fedit with UPX. To make it easy for everyone, I've posted an Fedit without icon and UPX-ed.

Edited by djbe
Link to comment
Share on other sites

  • 1 month later...

Hello everyone,

I've updated Fedit to v2.0. With this update I've totally rewritten Fedit, now there is almost no disk access, wich should result in a great speed increase, and new features such as case sensitive/unsensitive, substring searching and a "before" line.

Link to comment
Share on other sites

  • 1 year later...
Hello everyone,

I've updated Fedit to v2.0. With this update I've totally rewritten Fedit, now there is almost no disk access, wich should result in a great speed increase, and new features such as case sensitive/unsensitive, substring searching and a "before" line.

Very usefull tool. I'm using it whereas other tools (gsar.exe or sed.exe) canno't be used before T39 (ntvdm error in my VM Virtual Machine.

Missing is a replace option to change data:

gsar script

gsar -sPlayer:x22:x2c0x00010001:x2c1 -rPlayer:x22:x2c0x00010001:x2c0 -o ..\inf\syssetup.inf

sed script

move /y ..\inf\syssetup.inf ..\inf\syssetup.txt
sed 's/"Windows Media Player",0x00010001,1/"Windows Media Player",0x00010001,0/g' ..\inf\syssetup.txt >..\inf\syssetup.inf

fedit script

fedit -f ..\inf\syssetup.inf -rem -l:c "HKLM,\"SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\WindowsFeatures\",\"Windows Media Player\",0x00010001,1"
fedit -f ..\inf\syssetup.inf -add -l "HKLM,\"SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\WindowsFeatures\",\"Windows Media Player\",0x00010001,0" -s:c "WMPFeature.AddReg" -once

The 3 scripts do the same thing: replace value 1 with value 0 in this line

syssetup.inf

[WMPFeature.AddReg]HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\WindowsFeatures","Windows Media Player",0x00010001,0
Link to comment
Share on other sites

  • 2 years later...

this isn't working for me with -a switch wile -b switch seems to work just fine.

now I'm puzzled with this tool

do you need to specify the whole line to match or a partly matched will do ? what ever i did it did work with the -b switch so this question is a bit pointless

does it work for any of you guys if it does use what command?

TIA

Edited by sweept
Link to comment
Share on other sites

  • 3 months later...

Hi there,

Thank's for this great tool.

I'm currently trying to put some changes in my files HIVExxx.inf in i386 of an XP SP3 install CD.

Without success because those files are in UNICODE.

I'm trying to do some changes like:

fedit -add -f "HIVEDEF.INF" -s "AddReg" -l "HKCU,\"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\",\"StartMenuAdminTools\",0x00000000,\"YES\"" -once 
fedit -add -f "HIVEDEF.INF" -s "AddReg" -l "HKCU,\"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\",\"Hidden\",0x00010001,0x00000001" -once
fedit -add -f "HIVEDEF.INF" -s "AddReg" -l "HKCU,\"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\",\"ShowCompColor\",0x00010001,0x00000001" -once

Doing it on UNICODE file results in an unreadable file as result.

While converting *.INF files to ANSI before doing changes with fedit gave me the awaited result.

If you do not plan to integrate support for UNICODE in your tool, there is a workaround.

Just convert the file to ANSI before the change.

I did it with StringConverter.

This free command-line tool can be found at this address

Thank's again !

Myrmex

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