Batchfiles Ce 5.0 - Windows CE

This is a discussion on Batchfiles Ce 5.0 - Windows CE ; I have 2 problems: 1. I would like to call a batch and parameters in win ce 5.0 > batch.bat para1 para2 In the batchfile I wanted to get these parameters SET var1=%0 SET var2=%1 SET var3=%2 ECHO %var1% ECHO ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Batchfiles Ce 5.0

  1. Batchfiles Ce 5.0

    I have 2 problems:

    1. I would like to call a batch and parameters in win ce 5.0
    > batch.bat para1 para2


    In the batchfile I wanted to get these parameters

    SET var1=%0
    SET var2=%1
    SET var3=%2
    ECHO %var1%
    ECHO %var2%
    ECHO %var3%

    var1 is the pathname and name of the batchfile - this works
    var2 and var3 I get:
    > %VAR2%
    >%VAR3%


    2. I would like to use if in my batch:
    MSDN: IF [NOT] EXIST file_name command
    >IF EXIST \"Storage Card"\Batchfiles\Start.bat ECHO Storage Card


    is it possible to add more commands like
    IF EXIST \"Storage Card"\Batchfiles\Start.bat
    {
    ECHO Storage Card
    ECHO Test
    }

    Thank you
    Georg


  2. Re: Batchfiles Ce 5.0

    schliz wrote:
    > 1. I would like to call a batch and parameters in win ce 5.0
    >> batch.bat para1 para2

    >
    > In the batchfile I wanted to get these parameters
    >
    > SET var1=%0
    > SET var2=%1
    > SET var3=%2
    > ECHO %var1%
    > ECHO %var2%
    > ECHO %var3%
    >
    > var1 is the pathname and name of the batchfile - this works
    > var2 and var3 I get:
    >> %VAR2%
    >> %VAR3%


    I guess this is because they simply are not set. "set foo=" will reset the
    variable. Test the value before using it.

    > 2. I would like to use if in my batch:
    > MSDN: IF [NOT] EXIST file_name command
    >>IF EXIST \"Storage Card"\Batchfiles\Start.bat ECHO Storage Card

    >
    > is it possible to add more commands like
    > IF EXIST \"Storage Card"\Batchfiles\Start.bat
    > {
    > ECHO Storage Card
    > ECHO Test
    > }


    if exist "\foo\bar" (
    echo "foo"
    )

    BTW, in case you didn't know, CE does not have environment variables, so
    these variables are not propagated to any forked process!

    Uli

    --
    Sator Laser GmbH
    Geschäftsführer: Ronald Boers, Amtsgericht Hamburg HR B62 932


  3. Re: Batchfiles Ce 5.0

    On 27 Mrz., 11:19, Ulrich Eckhardt wrote:
    > schliz wrote:
    > > 1. I would like to call a batch and parameters in win ce 5.0
    > >> batch.bat para1 para2

    >
    > > In the batchfile I wanted to get these parameters

    >
    > > SET var1=%0
    > > SET var2=%1
    > > SET var3=%2
    > > ECHO %var1%
    > > ECHO %var2%
    > > ECHO %var3%

    >
    > > var1 is the pathname and name of the batchfile - this works
    > > var2 and var3 I get:
    > >> %VAR2%
    > >> %VAR3%

    >
    > I guess this is because they simply are not set. "set foo=" will reset the
    > variable. Test the value before using it.
    >
    > > 2. I would like to use if in my batch:
    > > MSDN: IF [NOT] EXIST file_name command
    > >>IF EXIST \"Storage Card"\Batchfiles\Start.bat ECHO Storage Card

    >
    > > is it possible to add more commands like
    > > IF EXIST \"Storage Card"\Batchfiles\Start.bat
    > > {
    > > ECHO Storage Card
    > > ECHO Test
    > > }

    >
    > if exist "\foo\bar" (
    > echo "foo"
    > )
    >
    > BTW, in case you didn't know, CE does not have environment variables, so
    > these variables are not propagated to any forked process!
    >
    > Uli
    >
    > --
    > Sator Laser GmbH
    > Geschftsfhrer: Ronald Boers, Amtsgericht Hamburg HR B62 932- Zitierten Text ausblenden -
    >
    > - Zitierten Text anzeigen -



    Thank you very much!

    1. ECHO %0 works but ECHO %1 passing a parameter does not.
    2. If I enter:
    IF EXIST \"Storage Card"\Batchfiles\Start.bat (
    > ECHO Storage Card

    ECHO Test
    )
    it says: can not execute (.exe

    Georg



  4. Re: Batchfiles Ce 5.0

    schliz wrote:
    > 2. If I enter:
    > IF EXIST \"Storage Card"\Batchfiles\Start.bat (
    >> ECHO Storage Card

    > ECHO Test
    > )
    > it says: can not execute (.exe


    I could imagine that the CE commandline is seriously crippled, I honestly
    don't know. I used the syntax on desktop systems and there it works.

    Uli

    --
    Sator Laser GmbH
    Geschäftsführer: Ronald Boers Steuernummer: 02/858/00757
    Amtsgericht Hamburg HR B62 932 USt-Id.Nr.: DE183047360


+ Reply to Thread