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
[327 byte] By [vikas_k_bhat] at [2007-11-19 1:08:13]
# 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
wrecklesswun at 2007-11-8 0:19:55 >
# 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 ?
vikas_k_bhat at 2007-11-8 0:21:06 >