1.

Solve : How run a vb script inside a Ms dos batch script??

Answer»

I have this .bat file script but the sent.vbs is not executing inside the bathc.
The sent.vbs executes perfectly from the "COMMAND prompt".

I don't know how to get to execute the vb script based on the "for", see:

set newDate=%date:~4,2%-%date:~7,2%-%date:~10%
for /f "delims=" %a in ('findstr /i /s "ORA- rejected EXP- ANS1312E ANS1329S failure FAILURE" c:\oracle\admin\secmonit\logs\exports_logs\export_db_secmonit_%newDate%.log') do (c:\oracle\admin\secmonit\scripts\sent.vbs)

The file export_db_secmonit_05-17-2008.log has an ANS1329S error inside of it.

you can try specifying cscript when you call your VBSCRIPT. however why should you do that when you can do all in vbscript
Code: [Select]YR = Year(Now)
mth = Month(Now)
If Len(mth) = 1 Then
mth = "0"&mth
End If
If Len(dday ) = 1 Then
dday = "0"&mth
End If
dday = DAY(Now)
NewDate = mth &"-"&dday&"-"&yr
Set objFSO =CreateObject("Scripting.FileSystemObject")
strMyFile = "C:\test\your_oracle_file"
strPattern = "ANS1329S failure"
Set objFS = objFSO.OpenTextFile(strMyFile)
Do Until objFS.AtEndOfLine
strLine = objFS.ReadLine
If InStr(1,strLine,strPattern) > 0 Then
WScript.Echo strLine
' sent.vbs code here.
End If

Loop
Thank you ghostdog74. The cscript worked.



Discussion

No Comment Found