Computing.Net > Forums > Programming > - help in vbs script -

- help in vbs script -

Reply to Message Icon

Original Message
Name: silversk8ter
Date: June 5, 2008 at 12:02:18 Pacific
Subject: - help in vbs script -
OS: win xp pro
CPU/Ram: p4 2.8
Model/Manufacturer: intel
Comment:

Hi all!
I'm pretty new to programing...i have bem "playing" with some batch files (simple ones), but now i've a question about a vbs script, hope any of you can help me out.

I have this vbs script:

Const ForReading = 1

Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = "[1-9].%"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("test.txt", ForReading)

Do Until objFile.AtEndOfStream
strSearchString = objFile.ReadLine
Set colMatches = objRegEx.Execute(strSearchString)
If colMatches.Count > 0 Then
CreateObject("Wscript.Shell").Run "calc.exe",0
End If
Loop
objFile.Close

He searches for some text in a txt file and then run's an aplication. Great!
My question is that it wont work in every machine i've tested...why's that? Something missing?

Also, if i run only a vbs file with the CreateObject line (CreateObject("Wscript.Shell").Run "calc.exe",0) it works in every machine..(win xp all)

Can u help me?
Thanks a lot


Report Offensive Message For Removal

Response Number 1
Name: silversk8ter
Date: June 6, 2008 at 10:45:45 Pacific
Subject: - help in vbs script -
Reply: (edit)

It's working at all!...sorry, my mistake.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: - help in vbs script -

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software