WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> execute .vbs from .bat
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1101757629

Message started by thuslin on Nov 29th, 2004 at 8:47pm

Title: execute .vbs from .bat
Post by thuslin on Nov 29th, 2004 at 8:47pm
Hello,

I read your forum regarding starting apps from a .bat file and have come up with an issue.  I have two .bat files, each invokes a program that has a UI.  One works via watchdirectory 3.1 and the other does not.  The one that works, invokes a utility program via its command-line which actually launches the GUI.  The one that doesn't work, is a .bat file that invokes a vb script (.vbs) that invokes a microsoft Access 97 compiled macro.  I can execute this main.bat from a command-line without issue by hand, just not via WatchDirectory.  Any pointers?

Thank you!

Title: Re: execute .vbs from .bat
Post by Gert on Nov 30th, 2004 at 4:11am
Hard to say what is happening.

What you could do to debug this issue is create a new "wrapper" .bat file like this:
[code]
SET ORIGBAT=C:\Bin\Original.bat
SET ERRLOG=C:\Temp\log.txt
echo starting original.bat >> "%ERRLOG%"
Call "%ORIGBAT%" >> "%ERRLOG%"  2>&1
[/code]

The original.bat would be your original .bat file (the one that causes troubles). Also edit your original.bat to make sure there are no "@ECHO OFF" lines in it.

If you let watchDirectory start this new wrapper.bat file, it will write all info (including possible errors) to c:\Temp\Log.txt.

I guess there is some kind of syntax error in your .bat file.

Gert

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.