Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1985 Posts in 537 Topics- by 1192 Members - Latest Member: cyndie

February 07, 2012, 03:21:36 PM
Dr. Blip's PC-Doctor® ForumDr. Blip's ForumAsk Our Experts (Moderators: Chris Hill, James_PCD, SMart)Command Line Processing
Pages: [1]
Print
Author Topic: Command Line Processing  (Read 1032 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
mchtower
Newbie
*
Offline Offline

Posts: 22


View Profile
« on: January 22, 2010, 11:57:26 AM »

When working from the command line is there is a way to detect errors? In others words if I have a batch file that executes multiple scripts using sccui.exe

sccui.exe -script z:\local_scripts\accelerated.xml -exit -sdtl
sccui.exe -script z:\local_scripts\accelerated2.xml -exit -sdtl

Is there a way to tell of instance accelerated.xml failed before I run accelerated2.xml?
Logged
fwilson
Hero Member
*****
Offline Offline

Posts: 784



View Profile
« Reply #1 on: January 22, 2010, 01:40:04 PM »

mchtower,

You could add the parameter to halt test on failure to the beginning of each script. This would cause testing to stop in its tracks when an error is encountered.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<Script haltonresults="FAIL">
        <TestSet>
   
This may or may not be exposed in the script editor so you may have to put it in in a standard text editor.

-Fred
Logged

“Integrity is doing the right thing, even if nobody is watching.”  ~ J.C. Watts
mchtower
Newbie
*
Offline Offline

Posts: 22


View Profile
« Reply #2 on: January 25, 2010, 11:51:41 AM »

Fred,

Thanks for your reply. That almost accomplished what I'm trying to do. Adding that code tp the beginning of accelerated.xml stops script execution when an error is found. However, accelerated2.xml is still executed and stopping that from happening is the second part of what I need to do.
Logged
fwilson
Hero Member
*****
Offline Offline

Posts: 784



View Profile
« Reply #3 on: January 26, 2010, 07:58:19 AM »

mchtower,

I see what you are trying to do.  Let me ask around and see what I can come up with. I'm pretty sure there is a way to accomplish that.

-Fred
Logged

“Integrity is doing the right thing, even if nobody is watching.”  ~ J.C. Watts
fwilson
Hero Member
*****
Offline Offline

Posts: 784



View Profile
« Reply #4 on: January 28, 2010, 03:45:07 PM »

mchtower,

Since the Batch file has ultimate control of the process the "smarts" would have to be built into it.  You can parse a text file from within a DOS batch file using the findstr command.  You could then exit the Batch file if the string FAILED is found in the logfile stopping any further execution.  Here is something I cobbled together to do such a thing:

@echo off
echo running 1st script
findstr /m "FAILED" c:\testlog.txt
if %errorlevel%==0 goto FAIL
echo running 2nd script
findstr /m "FAILED" c:\testlog2.txt
if %errorlevel%==0 goto FAIL
echo running 3rd script
findstr /m "FAILED" c:\testlog3.txt
if %errorlevel%==0 goto FAIL
echo All Passed
goto END
:FAIL
echo TEST FAILED
:end

This batch file will stop execution if FAILED is found in the referenced text file.

Here is an example of the findstr command:
http://www.computerhope.com/issues/ch001102.htm

Hope this helps.

-Fred

« Last Edit: January 29, 2010, 09:51:40 AM by fwilson » Logged

“Integrity is doing the right thing, even if nobody is watching.”  ~ J.C. Watts
mchtower
Newbie
*
Offline Offline

Posts: 22


View Profile
« Reply #5 on: February 03, 2010, 02:40:20 PM »

Fred,

That is EXACTLY what I needed, thanks!
Logged
fwilson
Hero Member
*****
Offline Offline

Posts: 784



View Profile
« Reply #6 on: February 03, 2010, 02:53:14 PM »

mchtower,

You are most welcome.

-Fred
Logged

“Integrity is doing the right thing, even if nobody is watching.”  ~ J.C. Watts
Pages: [1]
Print
Jump to:  

© 2012 PC-Doctor, Inc. ALL RIGHTS RESERVED.