Menu

How to refer to GUID in batch file?

xyz
2021-01-06
2021-01-07
  • xyz

    xyz - 2021-01-06

    I know that the program indicates that %guid can be used in the command line to refer to the GUID of an item, but I've been trying to refer to it in a batch file and I haven't been able to get it to work. The output is never the actual GUID of the item, just 'guid' or something else. The file attached shows what I've been trying. I have tried similar things with the other properties mentioned (%crc, %addr etc) but I couldn't get them to work either.

     

    Last edit: xyz 2021-01-06
  • Morten MacFly

    Morten MacFly - 2021-01-06

    The %guid (etc.) syntax is for WCM itself to replace this place-holder with the GUID when computing the command line.

    If you call a batch file and want to use these command line parameters there, you have to use the batch-file syntax for command line parameters which is %1 ... %9.

    So for example: If you setup in WCM:

    MyBatchFile.bat %addr %guid
    

    ...then in the batch file you'll have to enumerate these parameters like:

    @echo off
    REM Command line expected: 1st param: Address, 2nd param: GUID
    echo Address is: %1
    echo GUID is: %2
    

    Hope that helps...

     
  • xyz

    xyz - 2021-01-07

    Thanks, I've got my batch file working now

     

Anonymous
Anonymous

Add attachments
Cancel