Search This Blog

Unix dirname equivalent in Windows scripting

  • On Linux/Unix system:

echo `dirname $0`

  • On Windows system:


echo %~dp0

 

Other Equivalents:

Unix Bash Windows/DOS  
$@ %* all the arguments
$1, $2,$3, … %1,%2,%3, … argument

References:

  1. MS-DOS CALL command help
  2. DOS/Command Batch Scripting Quick Reference
  3. Converting DOS Batch Files to Shell Scripts

No comments:

Post a Comment