Home > Uncategorized > Getting the location of an executing batch script (.bat file)

Getting the location of an executing batch script (.bat file)

July 24th, 2009

A Windows batch script (.bat file) has an associated directory; the current working folder. It can be accessed in a batch file by the system variable %cd%. If instead, you want to obtain the location of the currently executing script, use %~dp0.

Note that both may be the same, but are not necessarily.

Uncategorized

  1. No comments yet.
  1. No trackbacks yet.