+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, Script to Find and Replace within an INI file. in Coding and Web Development; Hi all, I was wondering if anyone had a simple VB Script to open up ALL the ini files in ...
  1. #1

    Join Date
    Nov 2009
    Location
    somewhere
    Posts
    23
    Thank Post
    28
    Thanked 4 Times in 3 Posts
    Rep Power
    0

    Script to Find and Replace within an INI file.

    Hi all,

    I was wondering if anyone had a simple VB Script to open up ALL the ini files in a folder and its subdirectories and do a basic find and replace so it would replace "REPLACEME" with "IMREPLACED" if you see what I mean.

    Also does anyone know how to install Windows Remote Deployment Services silently on Windows Server 2003 (SP2 & R2)

    Thanks

  2. #2


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    338
    a one liner with sed and find
    Cygwin

    Code:
       find C:\  -type f  -name "*.ini" -exec  sed 's/REPLACEME/IMREPLACED/g'  > {} \;
    I not actually tried that, so might need some playing around with.



    edit:

    might be better with

    Code:
    #!/bin/bash
         for fl in *.ini; do
         mv $fl $fl.old
         sed 's/REPLACEME/IMREPLACED/g' $fl.old > $fl
         rm -f $fl.old
         done
    Last edited by CyberNerd; 4th February 2012 at 10:19 AM.

SHARE:
+ Post New Thread

Similar Threads

  1. MS Excel find and replace CR+LF
    By firefighting in forum Office Software
    Replies: 5
    Last Post: 20th November 2013, 08:18 AM
  2. Replies: 15
    Last Post: 16th September 2011, 09:03 AM
  3. Script to find serial numbers of all computers on network
    By bandgeekmafia78 in forum Scripts
    Replies: 3
    Last Post: 23rd May 2011, 05:11 PM
  4. Replies: 4
    Last Post: 20th March 2009, 10:15 AM
  5. Replies: 12
    Last Post: 21st November 2005, 09:49 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •