Greetings Vbscript Guru's,
I am a complete Novice so bare with with me.
This is my project I am working on.
I need to place the value entered(for e.g 1.1.1.1) in the inputbox into
a file where it is going to replace a variable called "ipaddress".
When the value is pasted there a new file will be created.
I am having trouble to use the popup box entered value I call it
"input" in my scenario.
See code below.
Thanks in advance for anyone who can help me out here.
AQUILA
-------------begin----------
Const ForReading = 1
Const ForWriting = 2
Dim Input
Set objFSO = CreateObject("Scripting.FileSystemObject")
Input = InputBox("Enter your IP address")
MsgBox ("You entered: " & Input)
Set objFile = objFSO.OpenTextFile("C:\scripts\test.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
strLine = Replace(strLine, "ipaddress", & Input)
strNewText = strNewText & strLine & vbCrLF
Loop
objFile.Close
Set objFile = objFSO.CreateTextFile("C:\scripts\test1.txt", ForWriting)
objFile.WriteLine strNewText
objFile.Close
--------------------------end------------