FW: [08/16] CMD.exe: Support return code if fail to launch program

Ann & Jason Edmeades us at edmeades.me.uk
Tue Feb 20 12:03:32 CST 2007



-----Original Message-----
From: Ann & Jason Edmeades [mailto:us at edmeades.me.uk] 
Sent: 20 February 2007 17:51
To: 'wine-patches at winehq.org'
Subject: FW: [08/16] CMD.exe: Support return code if fail to launch program



-----Original Message-----
From: Ann & Jason Edmeades [mailto:us at edmeades.me.uk] 
Sent: 20 February 2007 00:39
To: 'wine-patches at winehq.org'
Subject: [08/16] CMD.exe: Support return code if fail to launch program

This seems an odd return code which isn't documented but is relied upon
heavily if you google on it (and activestate installer for example checks
for perl's existence with it)
-------------- next part --------------
>From nobody Mon Sep 17 00:00:00 2001
From: Jason Edmeades <us at edmeades.me.uk>
Date: Sat Feb 17 22:47:47 2007 +0000
Subject: [PATCH] Set errorlevel to batch specific return code 9009

If a failure to launch an application occurs, errorlevel is
set to 9009, which appears to be a batch specific constant

---

 programs/cmd/wcmdmain.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

795728f2502eb041b76b777b7cda71b7d2675a3c
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index adb5a42..0a06099 100755
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -662,6 +662,9 @@ char filetorun[MAX_PATH];
   }
   if (!status) {
     WCMD_print_error ();
+    /* If a command fails to launch, it sets errorlevel 9009 - which
+       does not seem to have any associated constant definition     */
+    errorlevel = 9009; 
     return;
   }
   if (!console) errorlevel = 0;
-- 
1.3.0



More information about the wine-patches mailing list