Link to home
Start Free TrialLog in
Avatar of Wanting2LearnMan
Wanting2LearnManFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Get outout info from dos command

I'm running a dos script which runs an exe and passes in several parameters like so:

export.exe outputvideo camera1 file1

Open in new window


The out put on the dos command window is

Export Success or
Error video found!!


I need to know when it fails to retrieve video so I can log it.

How am I able to detect that the output is e.g. "Error video found"??

I have tried printing out the ERRORLEVEL but it is always 0.

Thanks
SOLUTION
Avatar of Bill Bach
Bill Bach
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wanting2LearnMan

ASKER

Thanks BillBach,

I have tested it and find that it's not finding a string that I want.
For example when I run the exe like so:
cbe.exe export-video %1 %time1% %time2% %2.ps
echo errorLevel: %ERRORLEVEL%

Open in new window

and it runs successfully the following is output:
export-video CAM:8 FROM:2012-09-20:15:11:27 TO:2012-09-20:15:11:28 FILE:10SecsAg
o.ps
Connected to IP:192.168.1.13 on Port:22609
Login Successful
0 of 140
1 of 140
2 of 140
3 of 140
4 of 140
5 of 140
6 of 140
7 of 140
8 of 140
9 of 140
10 of 140
11 of 140
12 of 140
14 of 140
15 of 140
16 of 140
17 of 140
18 of 140
19 of 140
20 of 140
21 of 140
22 of 140
23 of 140
24 of 140
25 of 140
26 of 140
27 of 140
28 of 140
errorLevel: 0

Open in new window




But when I run it again this time looking for "Login Succesful" (as a test)

cbe.exe export-video %1 %time1% %time2% %2.ps | FIND "Login Successful"
echo errorLevel: %ERRORLEVEL%

Open in new window


The following is the output:

Login Successful
errorLevel: 0

Open in new window


Do you know why the | FIND isn't working???

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks I'll get to it,

So why is the following text not displayed when I use the | FIND??

0 of 140
1 of 140
2 of 140
3 of 140
4 of 140
5 of 140
6 of 140
7 of 140
8 of 140
9 of 140
10 of 140
11 of 140
12 of 140
14 of 140
15 of 140
16 of 140
17 of 140
18 of 140
19 of 140
20 of 140
21 of 140
22 of 140
23 of 140
24 of 140
25 of 140
26 of 140
27 of 140
28 of 140

Open in new window


Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
re: Where does CBE.EXE come from, is it something I can download and try?
This is an internal exe that uses our own libraries so I'm sorry I cannot upload it.

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial