Jump to content

amio

Member
  • Posts

    11
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    China

About amio

amio's Achievements

0

Reputation

  1. 1.4.6 Last Session.ini files Uses in 1.4.8 as well as 1.4.7 remove language option intl.inf Some contents cannot delete Needs the manual choice remove language option
  2. 1.4.7 The question are many.
  3. It only took a couple minutes to make the changes. No thanks needed Yes, it could be. But I thought all you wanted was to remove a section. Right now I'm not totally sure what your real needs are (probably more than just removing some lines) I mean, if I add this, is the next request going to be "replacing a line" or such? -- not that there's anything wrong with that! But adding features like that one by one is more work than doing a fully featured app in the first place (this way, you're not deleting half your code every single time to add features, and making big changes in things like parsing command line arguments). I'd be better off to rewrite it all from scratch instead of just making changes to this very simple script all the time, and preferably in another language too (most likely as a C# Console App). It's pretty simple to do. I could make a fancy inf tool (with options to add/delete/replace values, lines and such, joining files, and maybe even simple taking commands from text files or such) and write basic documentation for it (i.e. command line usage, how to escape some characters, etc). I'll put it on my (long) list of pet projects. I'll get around to it sometime... I'm not quite sure just how much interest there is in such a tool, nor how useful it would be, so it's not exactly my top priority for now. I hope you make inf tool Similar http://www.msfn.org/board/Fedit-t48200.html
  4. Exactly. That works fine. You have to enclose parameters that have spaces in them with quotes (like for any other cmd line util), otherwise the 2 parts are passed as 2 separate arguments. Do you have unicode inf files? (I've never seen one as far as I recall). Either ways, you'd only need to make minor changes to the 2 lines that open files to make it work with unicode files, like such: Set f = fso.OpenTextFile(filename, 1, False, -1) '1=ForReading, -1=TristateTrue and Set f = fso.CreateTextFile(filename, True, True) If you have some of both kinds (again, strange...) then you could easily detect it (look for byte order mark, i.e. 0xFF 0xFE for Little Endian, first 2 bytes of the file), then open the file accordingly (wouldn't take 5 minutes to do) Thank you, have supported unicode Can be more functional? Designated Remove [Registry Keys] Arbitrary line Example: test.vbs test.inf "Registry Keys" HKLM,"SYSTEM\CurrentControlSet\Services\gagp30kx,"%gagp30kx_svcdesc% -------------------------------------------------------------------------------------------- test.inf [Registry Keys] aaa HKLM,"SYSTEM\CurrentControlSet\Services\gagp30kx,"%gagp30kx_svcdesc% bbb The revised: test.inf [Registry Keys] aaa bbb ----------------------------------------------------------------------------------------------
  5. Quite strange. It didn't write the empty elements of the array when I ran it on this box (or if it did, I must not have noticed) Easily solved though. Different version that definitely shouldn't have that problem: Option Explicit Dim fso, f, filename, section, data, i, j, s, skip ReDim data(500) i=0 skip = False filename = Wscript.Arguments(0) section = Wscript.Arguments(1) Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile(filename, 1) '1=ForReading Do Until f.AtEndOfStream s = f.ReadLine If skip=True And Left(s,1) = "[" Then skip=False 'stop skipping, new section reached (w/o a blank line) If s = "[" + section + "]" Then skip=True 'start skipping lines when section reached If skip=False Then data(i) = s i=i+1 If i = UBound(data) Then ReDim Preserve data(i+50) End If If s = "" Then skip = False 'reset once section end reached Loop f.Close Set f = fso.CreateTextFile(filename, True) For j = 0 to i-1 f.WriteLine data(j) Next f.Close Thank you Whether to support unicode or utf-8 If [] will include a space Will fail For example: [Registry Keys]
  6. amio, clearly you do have some problems in communicating in English, let's try again . Please post: 1) the actual file you need to modify 2) the batch or script you used to attempt modifying it 3) the file edited by hand as you would like it to have after changes jaclaz For instance DOSNET.INF I would like to use sed or other command Remove: [CmdConsFiles] autochk.exe autofmt.exe KBDFR.DLL KBDGR.DLL KBDHE.DLL KBDIT.DLL KBDRU.DLL KBDSF.DLL KBDSP.DLL KBDSW.DLL KBDUK.DLL KBDUS.DLL KBDUSX.DLL Take [CmdConsFiles] as the key words deletion
  7. Revises windows inf file (ANSI) commandline/script Treatment nlite Can not handle some of
  8. [] under all characters Example: Deletion text content [abcd] under all characters , Does not delete [efgh] -------------------------- [abcd] aaaaa bbbbb cc cccc ddddd [efgh] eeeeee ffffffff gg gggg hhhhhhh ---------------------------- After the revision: [efgh] eeeeee ffffffff gg gggg hhhhhhh
  9. Sorry I would like to call batch Put it in .Cmd or .Bat inside batch
  10. Would like to delete this special symbols in the text file .
×
×
  • Create New...