Hello!

I've to get the errorlevel of a DOS program.

How can I call i.e. ROBOCOPY from Windows Scriptinh Host and get the
errorlevel of it.

THX to all can help

Werner

Re: Get DOS errorlevel in WSH by Michael

Michael
Mon Jan 19 15:22:58 CST 2004

> I've to get the errorlevel of a DOS program.
>
> How can I call i.e. ROBOCOPY from Windows Scriptinh Host and get the
> errorlevel of it.

WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en

The look up (WshShell) Run method and the effect of the 3rd (bWaitOnReturn)
argument...

--
Michael Harris
Microsoft.MVP.Scripting

Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp

TechNet Script Center Sample Scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942



Re: Get DOS errorlevel in WSH by Saiz

Saiz
Mon Jan 19 15:43:07 CST 2004

Hi Michael!

Thx for your help, but I've coded it you wrote.
I get errorcode 3 when calling Robocopy. Maybe it is undocumented.

best regards
Werner


"Michael Harris (MVP)" <mikhar at mvps dot org> schrieb im Newsbeitrag
news:O9k0PJt3DHA.2280@TK2MSFTNGP10.phx.gbl...
> > I've to get the errorlevel of a DOS program.
> >
> > How can I call i.e. ROBOCOPY from Windows Scriptinh Host and get the
> > errorlevel of it.
>
> WSH 5.6 documentation download
>
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-
8A76-1C4099D7BBB9&displaylang=en
>
> The look up (WshShell) Run method and the effect of the 3rd
(bWaitOnReturn)
> argument...
>
> --
> Michael Harris
> Microsoft.MVP.Scripting
>
> Windows 2000 Scripting Guide
> Microsoft® Windows®2000 Scripting Guide
> http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp
>
> TechNet Script Center Sample Scripts
> http://www.microsoft.com/downloads/release.asp?ReleaseID=38942
>
>



Re: Get DOS errorlevel in WSH by Torgeir

Torgeir
Mon Jan 19 16:10:11 CST 2004

Saiz Werner wrote:

> I get errorcode 3 when calling Robocopy. Maybe it is undocumented.

Hi

Based on this article
http://groups.google.com/groups?selm=apj0nsk14tnjaoprb72ng16b2dumim9lo1%404ax.com

error level 3 really means 1+2 (because the Robocopy error level is a bit map):

0x02 2 Some Extra files or directories were detected. Examine the
output log. Some housekeeping may be needed.
0x01 1 One or more files were copied successfully (that is, new files
have arrived).


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Re: Get DOS errorlevel in WSH by Michael

Michael
Mon Jan 19 16:21:31 CST 2004

> Thx for your help, but I've coded it you wrote.
> I get errorcode 3 when calling Robocopy. Maybe it is undocumented.


I don't have the reskit installed, so I don't have the robocopy.doc. But
this thread should help you (hint: 3 is 0x02 + 0x01)...

Google Search: robocopy errorlevel 3 group:microsoft.*
http://groups.google.com/groups?q=robocopy+errorlevel+3+group:microsoft.*&hl=en&lr=lang_en&ie=UTF-8&scoring=d&selm=apj0nsk14tnjaoprb72ng16b2dumim9lo1%404ax.com&rnum=3



--
Michael Harris
Microsoft.MVP.Scripting

Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp

TechNet Script Center Sample Scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942

WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en


Re: Get DOS errorlevel in WSH by Saiz

Saiz
Mon Jan 19 16:22:27 CST 2004

Hi Torgeir!

All right! It's true, it's bitmapping of some errorlevel.

Thx for helping

best regards
Werner


"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> schrieb im
Newsbeitrag news:400C55C3.4B78CDFE@hydro.com...
> Saiz Werner wrote:
>
> > I get errorcode 3 when calling Robocopy. Maybe it is undocumented.
>
> Hi
>
> Based on this article
>
http://groups.google.com/groups?selm=apj0nsk14tnjaoprb72ng16b2dumim9lo1%404a
x.com
>
> error level 3 really means 1+2 (because the Robocopy error level is a bit
map):
>
> 0x02 2 Some Extra files or directories were detected. Examine the
> output log. Some housekeeping may be needed.
> 0x01 1 One or more files were copied successfully (that is, new files
> have arrived).
>
>
> --
> torgeir
> Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of the 1328 page
> Scripting Guide: http://www.microsoft.com/technet/scriptcenter
>
>



Re: Get DOS errorlevel in WSH by Saiz

Saiz
Mon Jan 19 16:24:05 CST 2004

Also Thx to Michael.
I already have it.

Werner



"Michael Harris (MVP)" <mikhar at mvps dot org> schrieb im Newsbeitrag
news:eODz9pt3DHA.3936@TK2MSFTNGP11.phx.gbl...
> > Thx for your help, but I've coded it you wrote.
> > I get errorcode 3 when calling Robocopy. Maybe it is undocumented.
>
>
> I don't have the reskit installed, so I don't have the robocopy.doc. But
> this thread should help you (hint: 3 is 0x02 + 0x01)...
>
> Google Search: robocopy errorlevel 3 group:microsoft.*
>
http://groups.google.com/groups?q=robocopy+errorlevel+3+group:microsoft.*&hl
=en&lr=lang_en&ie=UTF-8&scoring=d&selm=apj0nsk14tnjaoprb72ng16b2dumim9lo1%40
4ax.com&rnum=3
>
>
>
> --
> Michael Harris
> Microsoft.MVP.Scripting
>
> Windows 2000 Scripting Guide
> Microsoft® Windows®2000 Scripting Guide
> http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp
>
> TechNet Script Center Sample Scripts
> http://www.microsoft.com/downloads/release.asp?ReleaseID=38942
>
> WSH 5.6 documentation download
>
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-
8A76-1C4099D7BBB9&displaylang=en
>