Posted By

noah on 06/03/09


Tagged

Shell script windows batch dos bat Microsoft MS


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Special variables in Windows Batch files


 / Published in: DOS Batch
 

URL: http://delicious.com/thefangmonster/bat

Below are the .bat file variables that come in handy most often for me.

This MS article has more information on batch files including a table of more special variables, including %~$PATH:1, which

"Searches the directories listed in the PATH environment variable and expands %1 to the fully qualified name of the first one found."

  1. rem special variables for batch files
  2.  
  3. @echo off
  4.  
  5.  
  6. echo fully qualified name of this batch file:
  7.  
  8. echo %~fn0
  9.  
  10.  
  11. echo path to here:
  12.  
  13. echo %~dp0
  14.  
  15.  
  16. echo arguments passed (if any):
  17.  
  18. echo %*

Report this snippet  

You need to login to post a comment.