Sign in with
Sign up | Sign in
Your question

Batch file question

Tags:
  • Microsoft
  • Command Prompt
  • Windows XP
Last response: in Windows XP
Share
Anonymous
August 20, 2005 5:03:20 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Hello, All! please find here below my batch file.
(isdate d:\batch\temp.txt NOT EQUAL TODAY
if errorlevel 1 set true_=No
if errorlevel 0 set true_=Yes)

Even when the isdate command returns an errorlevel 1 the variable true_ sets
Yes. Somebody please point out the error in the batch file. Thanks in
advance.

With best regards, Brother Brock. E-mail: Nobodyknows@unknown.com

More about : batch file question

August 20, 2005 5:03:21 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

What does "isdate" do ?

Mik

"Brother Brock" <Nobodyknows@unknown.com> wrote in message
news:o R5ZgTPpFHA.3996@TK2MSFTNGP12.phx.gbl...
> Hello, All! please find here below my batch file.
> (isdate d:\batch\temp.txt NOT EQUAL TODAY
> if errorlevel 1 set true_=No
> if errorlevel 0 set true_=Yes)
>
> Even when the isdate command returns an errorlevel 1 the variable
true_ sets
> Yes. Somebody please point out the error in the batch file. Thanks
in
> advance.
>
> With best regards, Brother Brock. E-mail: Nobodyknows@unknown.com
>
>
Anonymous
August 20, 2005 5:03:22 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

http://msdn.microsoft.com/library/default.asp?url=/libr...

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:o N7dqbQpFHA.3036@TK2MSFTNGP14.phx.gbl,
Mik <Mik@No-spam-mail.com> hunted and pecked:
> What does "isdate" do ?
>
> Mik
>
> "Brother Brock" <Nobodyknows@unknown.com> wrote in message
> news:o R5ZgTPpFHA.3996@TK2MSFTNGP12.phx.gbl...
>> Hello, All! please find here below my batch file.
>> (isdate d:\batch\temp.txt NOT EQUAL TODAY
>> if errorlevel 1 set true_=No
>> if errorlevel 0 set true_=Yes)
>>
>> Even when the isdate command returns an errorlevel 1 the variable true_
>> sets Yes. Somebody please point out the error in the batch file. Thanks
>> in advance.
>>
>> With best regards, Brother Brock. E-mail: Nobodyknows@unknown.com
Anonymous
August 20, 2005 5:20:05 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

"Brother Brock" <Nobodyknows@unknown.com> wrote:

>Hello, All! please find here below my batch file.
>(isdate d:\batch\temp.txt NOT EQUAL TODAY
>if errorlevel 1 set true_=No
>if errorlevel 0 set true_=Yes)
>
>Even when the isdate command returns an errorlevel 1 the variable true_ sets
>Yes. Somebody please point out the error in the batch file. Thanks in
>advance.
>
>With best regards, Brother Brock. E-mail: Nobodyknows@unknown.com
>

errorlevel works on an "equal to or greater than" basis so you must
use a goto command to skip past the tests for lower values.


Try this:

if errorlevel 1 goto level1
(the preceding line will be processed if errorlevel is 1 or higher)

set true_=Yes
goto finish
(the above 2 lines will be processed only if errorlevel is less than
1)


:level1
set true_=No

:finish
(balance of batch file commands)

Good luck

Ron Martell Duncan B.C. Canada
--
Microsoft MVP
On-Line Help Computer Service
http://onlinehelp.bc.ca

In memory of a dear friend Alex Nichol MVP
http://aumha.org/alex.htm
!