13 years ago
VBScript For Loop
I’m writing this vbscript in a in testcomplete. I’m having trouble with a loop… I don’t know if I need an If…else.. The script has a ADO connection that looks at a ta...
Hi,
i am a newbie with vbscript and would apppreciate if you can help me. I have a for loop below and i am having problem on how the loop will exit whenever the inputbox is blank or the loop will exit if Cancel is click..below is my for loop vbscript....Thanks in Advance.
Dim fso, tf
'Dim Msg As Variant
Dim loopIndex
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("c:\Test\pcname.txt", True)
For loopIndex = 0 To 5
Msg = InputBox("Input PC Name in FQDN Format (e.g. PC1.domain.com) Then click
OK button to proceed Or Click Cancel to Terminate.", "Input Window")
tf.WriteLine(Msg)
Next
tf.Close
Danny