How to use `%` in a batch file

ironsand

I want to associate a extension to a program by a batch file.

This command works fine when I write it interactively.

ftype wavfile="%ProgramFiles(x86)%\VideoLAN\VLC\vlc.exe" "%1"

But when I write it in a batch file and run, then %1 are recognized as a variable, so it ends up with:

ftype wavfile="%ProgramFiles(x86)%\VideoLAN\VLC\vlc.exe" ""

I think someone already ask a same question, but I couldn't find it. How can I use %1 or some other argument variables in a batch file?

Linus

You should use two percentage symbols like this: %%1, which will work for a batch file.

It will escape the %% into a percent sign.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to use if statement in batch file?

From Dev

Batch file - How to use FindStr with percent

From Dev

How to use "<<" in batch file or command prompt?

From Dev

How to write, and use, a text batch command file

From Dev

How to use nested variable abstraction in batch file?

From Dev

how to use sed command in batch file

From Dev

How to use launch commands in a batch file

From Dev

how to use environment variable in batch file

From Dev

How to use batch file to compare and get uuid

From Java

How can I use a batch file to write to a text file?

From Dev

how to read file with batch and use it in loop to write in temporary file

From Dev

How to use variable of batch file into VB script file

From Dev

Unexpected use of ( batch file

From Dev

Unexpected use of ( batch file

From Dev

How to use regexp in windows batch file to start a installation?

From Dev

How to use the Chef knife utility from a Windows batch file?

From Dev

How to use batch file to give a folder permission to the Everyone group

From Dev

how to set variable on window batch file for private use only

From Dev

How to use variables (their values) as tokens with the for command - Win BATCH file

From Dev

How do I use a batch file to recursively replace a string in files?

From Dev

How to Use Batch File - Simple Application to Restart Audio Drivers

From Dev

How to use the output of one operation as input for other operation in batch file?

From Dev

How to store and use the value of a batch file for loop variable

From Dev

How to use the Chef knife utility from a Windows batch file?

From Dev

how to set variable on window batch file for private use only

From Dev

How to make a batch file to use Flex command line debugger?

From Dev

How to declare a variable in a Slurm batch file and use it in the multiprog conf?

From Dev

How to create a batch file that creates a batch file that creates a batch file

From Dev

Use CreateProcess to Run a Batch File

Related Related

  1. 1

    How to use if statement in batch file?

  2. 2

    Batch file - How to use FindStr with percent

  3. 3

    How to use "<<" in batch file or command prompt?

  4. 4

    How to write, and use, a text batch command file

  5. 5

    How to use nested variable abstraction in batch file?

  6. 6

    how to use sed command in batch file

  7. 7

    How to use launch commands in a batch file

  8. 8

    how to use environment variable in batch file

  9. 9

    How to use batch file to compare and get uuid

  10. 10

    How can I use a batch file to write to a text file?

  11. 11

    how to read file with batch and use it in loop to write in temporary file

  12. 12

    How to use variable of batch file into VB script file

  13. 13

    Unexpected use of ( batch file

  14. 14

    Unexpected use of ( batch file

  15. 15

    How to use regexp in windows batch file to start a installation?

  16. 16

    How to use the Chef knife utility from a Windows batch file?

  17. 17

    How to use batch file to give a folder permission to the Everyone group

  18. 18

    how to set variable on window batch file for private use only

  19. 19

    How to use variables (their values) as tokens with the for command - Win BATCH file

  20. 20

    How do I use a batch file to recursively replace a string in files?

  21. 21

    How to Use Batch File - Simple Application to Restart Audio Drivers

  22. 22

    How to use the output of one operation as input for other operation in batch file?

  23. 23

    How to store and use the value of a batch file for loop variable

  24. 24

    How to use the Chef knife utility from a Windows batch file?

  25. 25

    how to set variable on window batch file for private use only

  26. 26

    How to make a batch file to use Flex command line debugger?

  27. 27

    How to declare a variable in a Slurm batch file and use it in the multiprog conf?

  28. 28

    How to create a batch file that creates a batch file that creates a batch file

  29. 29

    Use CreateProcess to Run a Batch File

HotTag

Archive