none
What kind of script language is that? RRS feed

  • Question

  • I would like to know on what kind of script language is that and what it mean in scripts.

    if /I "%HIDE%" == "YES" (

    if /I "%~1" == "/INLINE" (

    Does anyone have any suggestions?
    Thanks in advance for any suggestions


    Thanks in advance for any suggestions

    Thursday, May 3, 2018 2:02 PM

Answers

All replies

  • It is cmd.exe shell script (batch).

    Type if /? at a cmd.exe prompt for the documentation of the if command.


    -- Bill Stewart [Bill_Stewart]

    Thursday, May 3, 2018 2:16 PM
    Moderator
  • I would like to know on what is being assigned into ARG variable based on following coding.

    set ARG=%~1

    Do you have any suggestions?
    Thank you very much for any suggestions (^v^)


    Thanks in advance for any suggestions

    Thursday, May 3, 2018 2:35 PM
  • Type the following command at at cmd.exe prompt for more information:

    set /?


    -- Bill Stewart [Bill_Stewart]

    Thursday, May 3, 2018 2:39 PM
    Moderator
  • I cannot find any example to show what is being assigned into variable with %~1.

    Do you have any suggestions?
    Thank you very much for any suggestions (^v^)


    Thanks in advance for any suggestions

    Thursday, May 3, 2018 3:00 PM
  • There is not any need to be helpless. Write a short batch file and experiment. Read the documentation (set /?, if /?, for /?).

    Better yet: Don't write a batch file at all and use PowerShell.


    -- Bill Stewart [Bill_Stewart]

    Thursday, May 3, 2018 3:07 PM
    Moderator
  • Please see below sample, it returns %~1, but I don't know what %~1 represent here, does it represent a quote sign?

    Do you have any suggestions?
    Thank you very much for any suggestions (^v^)


    Thanks in advance for any suggestions

    Thursday, May 3, 2018 3:13 PM
  • This is one of the reasons we recommend PowerShell...

    With cmd.exe shell scripts (batch files), script behavior is different depending on whether you type the command at a command prompt or you put the lines in a .cmd (or .bat) file and run it.

    (Note: This is why I said to write a sample batch file. I did not say to type commands at the command prompt.)

    Try this sample batch file (test.cmd):


    @echo off
    setlocal enableextensions
    set ARG=%~1
    echo ARG=%ARG%
    endlocal
    

    Run the script with various parameters.

    Then try removing the ~ character and observe the results.


    -- Bill Stewart [Bill_Stewart]


    Thursday, May 3, 2018 4:00 PM
    Moderator