How to take name from file with specific extension and use it as variable in batch script?

Sigurica

Can anyone tell me how to take name from specific file with specific extension (.pdf) and use it as variable? Thanks in advance...

TessellatingHeckler
for %%f in (*.pdf) do ( 
    set x=%%f
)
echo %x%

Assuming there's only one PDF in the current directory.

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 could I get the name of a specific file but not use the extension from a path?

From Dev

How to use variable of batch file into VB script file

From Dev

How to associate a file extension to be opened with a batch script?

From Dev

How I can write the name of a file from a variable in Batch

From Dev

How to pass variable from Batch File to a Powershell Script

From Dev

Change the name of file using windows batch script (keeping extension)?

From Dev

How to echo variable name to batch file so the destination file can use the variable

From Dev

Setting Lines From A File to a Variable in Batch Script

From Dev

Batch script to take file list input from user to feed to WinSCP

From Dev

Batch script to take file list input from user to feed to WinSCP

From Dev

How do I write a batch script to search for a specific file based on folder name?

From Java

using a variable inside a batch script for loop instead of file name

From Dev

Batch script - how to take last column from a text line

From Dev

How to extract extension of input file parameter using Windows batch script

From Dev

How to use nested variable abstraction in batch file?

From Dev

how to use environment variable in batch file

From Dev

Batch How to remove file extension stored in string %variable%?

From Dev

How can I copy a file with a BATCH script from a folder on one drive to a folder of the same name on another drive?

From Java

How to run a PowerShell script from a batch file

From Dev

Batch file to loop through subfolder and use subfolder name as variable

From Dev

Love to get the output of powershell script in a variable to use in a batch file

From Dev

Love to get the output of powershell script in a variable to use in a batch file

From Dev

Batch File to Replace string in file name and extension

From Dev

How do I pass a computer name as a variable to the PowerShell -ComputerName from a batch file?

From Dev

Need Batch script to search and copy specific file from network drive

From Dev

Skip line with a specific string from a file - Batch script

From Dev

Batch script to copy SPECIFIC FILE from network folder to drive D:\

From Dev

how I can call from batch file a java script function with 2 arguments and return the result to a dos variable

From Dev

Getting the source .exe file name from .lnk shortcut in batch script?

Related Related

  1. 1

    How could I get the name of a specific file but not use the extension from a path?

  2. 2

    How to use variable of batch file into VB script file

  3. 3

    How to associate a file extension to be opened with a batch script?

  4. 4

    How I can write the name of a file from a variable in Batch

  5. 5

    How to pass variable from Batch File to a Powershell Script

  6. 6

    Change the name of file using windows batch script (keeping extension)?

  7. 7

    How to echo variable name to batch file so the destination file can use the variable

  8. 8

    Setting Lines From A File to a Variable in Batch Script

  9. 9

    Batch script to take file list input from user to feed to WinSCP

  10. 10

    Batch script to take file list input from user to feed to WinSCP

  11. 11

    How do I write a batch script to search for a specific file based on folder name?

  12. 12

    using a variable inside a batch script for loop instead of file name

  13. 13

    Batch script - how to take last column from a text line

  14. 14

    How to extract extension of input file parameter using Windows batch script

  15. 15

    How to use nested variable abstraction in batch file?

  16. 16

    how to use environment variable in batch file

  17. 17

    Batch How to remove file extension stored in string %variable%?

  18. 18

    How can I copy a file with a BATCH script from a folder on one drive to a folder of the same name on another drive?

  19. 19

    How to run a PowerShell script from a batch file

  20. 20

    Batch file to loop through subfolder and use subfolder name as variable

  21. 21

    Love to get the output of powershell script in a variable to use in a batch file

  22. 22

    Love to get the output of powershell script in a variable to use in a batch file

  23. 23

    Batch File to Replace string in file name and extension

  24. 24

    How do I pass a computer name as a variable to the PowerShell -ComputerName from a batch file?

  25. 25

    Need Batch script to search and copy specific file from network drive

  26. 26

    Skip line with a specific string from a file - Batch script

  27. 27

    Batch script to copy SPECIFIC FILE from network folder to drive D:\

  28. 28

    how I can call from batch file a java script function with 2 arguments and return the result to a dos variable

  29. 29

    Getting the source .exe file name from .lnk shortcut in batch script?

HotTag

Archive