Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Trying to add to a host file in a specific place.

$
0
0
Here is an example host file...

# Copyright © 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#   102.54.94.97 rhino.acme.com   # source server
#    38.25.63.10 x.acme.com   # x client host
127.0.0.1    localhost


I would like to add a comment line and add data between it, like this...



# Copyright © 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#   102.54.94.97 rhino.acme.com   # source server
#    38.25.63.10 x.acme.com   # x client host
127.0.0.1    localhost
#
#
#
#New Stuff
#
#blah
#blah
#blah
#END OF NEW STUFF

So basically I want to write data between NEW STUFF and END OF NEW STUFF.  So I can make sure and not touch any other data.  I looked at SetFilePos, but I couldnt see this functionality.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>