cant redirect error message?

  • Thread starter Thread starter Marcin Wiszowaty
  • Start date Start date
M

Marcin Wiszowaty

Hello all,

I am working with Windows XP on a file watcher idea.
The basic idea is to make entrys into sql table as to the file name pattern
and incoming directory.
Have a vb program look in the directory and when it sees the files kick of a
..bat file to process whatever file.

This is basicaly done.

My problem is when i try to create log files.
I figured i could create a log file and then parse it into a table as a
monitoring of what gets kicked off.

The problem is that the >> operator doesnt seem to work for me.
i try the command "md one". When the "one" directory already created.
When i have command window open i get the error: Directory already exists.

but "md one >> one.log" does not give me the error to the log file.

Why is that?

Any good advice from your experiences on this whole filewatcher idea?

Thank you.
Marcin
 
Marcin Wiszowaty said:
Hello all,

I am working with Windows XP on a file watcher idea.
The basic idea is to make entrys into sql table as to the file name
pattern and incoming directory.
Have a vb program look in the directory and when it sees the files kick of
a .bat file to process whatever file.

This is basicaly done.

My problem is when i try to create log files.
I figured i could create a log file and then parse it into a table as a
monitoring of what gets kicked off.

The problem is that the >> operator doesnt seem to work for me.
i try the command "md one". When the "one" directory already created.
When i have command window open i get the error: Directory already exists.

but "md one >> one.log" does not give me the error to the log file.

Why is that?

Any good advice from your experiences on this whole filewatcher idea?

Thank you.
Marcin

"Redirection" requires cmd.exe, which you probably did not
invoke. However, if you want a good answer then you must
post your code.
 
Hello all,

I am working with Windows XP on a file watcher idea.
The basic idea is to make entrys into sql table as to the file name pattern
and incoming directory.
Have a vb program look in the directory and when it sees the files kick of a
.bat file to process whatever file.

This is basicaly done.

My problem is when i try to create log files.
I figured i could create a log file and then parse it into a table as a
monitoring of what gets kicked off.

The problem is that the >> operator doesnt seem to work for me.
i try the command "md one". When the "one" directory already created.
When i have command window open i get the error: Directory already exists.

but "md one >> one.log" does not give me the error to the log file.

Why is that?

Any good advice from your experiences on this whole filewatcher idea?

Thank you.
Marcin

Error codes (StdErr device) are redirected at the command prompt be
the 2> or 2>> designations. While the StdOut redirection is the
presumed default, it can also be written as 1> or 1>> for appending.

So to get both into the same file use either ...

md one >> one.log 2>> one.log

or

md one 1>> one.log 2>> one.log

of to keep from having to define the file's pathspec twice use this
shorthand ...

md one 1>> one.log 2>>&1

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
 
Have a vb program look in the directory and when it sees the files kick of a
.bat file to process whatever file.

Any good advice from your experiences on this whole filewatcher idea?

Is this any use to replace the VB file?

@echo off
:loop
if exist "c:\folder\filedat.*" (
echo process routines here
)
:: pause for ~ 10 minutes ~= 600 seconds
echo waiting...
ping -n 600 127.0.0.1 >nul
:: look for more files
goto :loop
 
Back
Top