VB Script: Calling a BAT file and checking whether the file exists
Hi,
I have a XYZ.BAT file which checks for something and dumps a file done.txt under C:\temp. I want to call XYZ.BAT in VB script file and I want check whether it has dumped done.txt file under c:\temp
that is
call XYZ.BAT
if not exist C:\temp\done.txt goto endChecking
Thanks
Vikas
# 1 Re: VB Script: Calling a BAT file and checking whether the file exists
Set objFSO = CreateObject("Scripting.FileSystemObject")
if objfso.fileexists("yourfile") then
your action here
end if
# 2 Re: VB Script: Calling a BAT file and checking whether the file exists
Thanks. But if I try to execute pushd . using Exec it gives me an error !!
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("pushd .")
Do While oExec.Status = 0
WScript.Sleep 100
Loop
WScript.Echo oExec.Status
Do you know why ?