Re: %errorlevel% and run/exec command



Having to code around error levels is like shooting paint balls against a moving target..

It is the 'modern' computer 'pulling' methodology, called "asking for comment"..

The target will swipe them away and know you better next time, posts to the net.
--------------------------------------------------------------------------------------

Before you then are offered to buy 'stripped' hard candies or nuclear missles covered in chocolate.

================================================

A decent exe is meant to accept and return anything from 0-9 and A-Z.

That is original switches aka "/reinstall" for the literate.

================================================

BAhhhh, wsh, monad, year,century - > last millenium

Be realistic

---------------------------------------------------------------------------------------

The G8 pledged 80 Billion to Africa. Of course 30 Billion new money form the US.

Yeah, Mr, Gates, what when the totally aged see this once romantic relationship with the world
to end in an inconclusive terminator seed attitude.

You were doing a really great job, Mr. Windows.


In 1992







"Al Dunbar" <AlanDrub@xxxxxxxxxxxxxxxxxxx> wrote in message news:eTz6MgqqHHA.3380@xxxxxxxxxxxxxxxxxxxxxxx

"Michael Harris (MVP)" <mikhar.at.mvps.dot.org> wrote in message news:uSiMjIiqHHA.1296@xxxxxxxxxxxxxxxxxxxxxxx
fbesson wrote:
Hi,

I have a simple DOS batch which install some patches and process
additional function based on %errorlevel%.

....
echo Here is the command ".\%patch_exe% %Patch_option%"
.\%patch_exe% %Patch_option%
set Install_RC= %errorlevel%
...

Now, I'd like to simply write the same thing in wsh and I have tried
different approach using the reference:
http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_pkoy.mspx?mfr=true,
reading STDOUT and so on... but I'm not retrieving %errorlevel% value.
my perception is that when use RUN method, you can control the process
execution really have dependencies but you can get the output of the
execution and we use EXEC you can get the output but where
syncronization the child process.

Thanks for any example as I'm sure that my previous is not accurate.

The WshScriptExec object returned by the WshShell.Exec method has an...

ExitCode Property
<http://msdn2.microsoft.com/en-us/library/za76z6hh.aspx>

Download details: Windows Script Documentation
http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en

By way of further explanation to the OP, it should be recognized that ERRORLEVEL is one of seven "dynamic environment variables" that are "computed dynamically each time the value of the variable is expanded" (see the "set /?" command for info). This is a function of CMD.EXE command extensions, which are likely not involved when a WSH script launches an executable.

/Al



.



Relevant Pages

  • RE: C# Exceptions
    ... no one has successfully executed code using a buffer ... successfully used a .net overrun to execute code. ... do code execution via the stack would be if the target app used. ...
    (Pen-Test)
  • Re: xpc target ERROR: CPU OVERLOADED AT TIME
    ... To minimize tcp ip network latency between target and host computers, ... With sampling frequencies below 10 kHz, the execution runs normally. ...
    (comp.soft-sys.matlab)
  • Re: Embedded Basic interpreter recommendations?
    ... Code size and execution time should be no problem, ... but the rest is important for interactive development on the target ... And do all of that in a relatively small part of the flash -- which, ...
    (comp.arch.embedded)
  • RE: Application and System Security (was: RE: Honeypot stats)
    ... > passwords, or that controls the execution of code, is a risk and is ... > an obvious target. ... to implement application level authentication just go down the list ...
    (comp.os.vms)