Recently because the company often want to change the server, the client under the files often need to change the IP,
Now I need is this file whether it is installed in the disk C D dish, or other dish, whether there is a few class path can check and modify the file of poor IP
The following is according to online and I have written: (only solve the problem of IP in modify the file) :
On the Error Resume Next
Dim Fso, IniFl, Str, IniFn
IniFn="abctest. Ini"
The Set of Fso=CreateObject (" Scripting. FileSystemObject ")
The Set IniFl=Fso. OpenTextFile (" D: \ NASA \ TEST \ "& amp; IniFn, 1)
Str=Replace (IniFl ReadAll, "ServerName=192.168.60.250", "ServerName=192.168.10.250")
The Set IniFl=Fso. OpenTextFile (" D: \ NASA \ TEST \ "& amp; IniFn, 2)
IniFl. Write the Str
IniFl. Close
Help please prawns, write a complete point ah, I am not at all,
P. finally can be best to remove the VBS, of course the best and whatever path after the executable to delete,
!!!!!!!!! Online, online to refresh!!!!!!!!!!
CodePudding user response:
From already, can't sink!CodePudding user response:
Is there any free points of prawns?CodePudding user response:
C: \ & gt; findstr searches/?Looking for strings in files.
FINDSTR searches [/B] [/B] [/M] [/R]/[S] [/I] [/X] [/V] [/N] [/M] [/O] [/F: file]
[/C: string] [/G: file] [/D: dir list] [/A: color attributes] [/OFF [the LINE]]
Strings [[drive:] [path] filename [...]]
/B at the beginning of a line matching pattern,
/E at the end of a line matching pattern,
/L by keyword using a search string,
/R will search string used as a general expression,
/S in the current directory search matching files and subdirectories in a directory,
/I specify search case insensitive,
Print completely matching line/X,
Print does not include the matching line/V only,
/N every before printing of the matching rows,
/M if the file contains a match, only print the filename,
/O in each match before character offset printing,
/P ignore file with the nonprintable characters,
/OFF [the LINE] don't skip with offline file attributes,
/A: attr hexadecimal digits are destined to color attribute, please see the "color/?"
/F: file read file list from the specified file (/on behalf of the console),
/C: string using the specified string as a text search string,
/G: file get search string from the specified file, (/on behalf of the console),
/D: dir find a semicolon as separators directory list
Strings to find words,
[drive:] [path] filename
To find the specified file,
Prefix unless parameters have a/C, please use the space separated by a search string,
For example: 'FINDSTR searches "hello there" x.y' seeking "hello" or in file x.y
"There," 'FINDSTR searches/C: "hello there" x.y' file x.y looking for
"Hello there,"
The general expression of quick reference:
Wildcard: any characters
* repeat: characters or number of categories of zero or more than zero before
^ line location: the beginning of a line of
$row position: the end
Categories: [class] characters in any character set characters
[^ class] fill character categories: any character not in the character set
Scope: x-y in any character within the specified range
\ x Escape: metacharacters word usage of x
\ & lt; Xyz position: words start
Xyz \ & gt; Location: the end of the word is
About the FINDSTR searches the common expression of the details, please see online command reference,