Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch file equivalent of CURRENTDIR="$PWD"?

I'm trying to translate a very simple (Unix) shell script into a "batch file". I have most of it down, except for the line

CURRENTDIR="$PWD" 

How can I translate this to "batchese"?

Thanks!

like image 456
kjo Avatar asked May 04 '12 22:05

kjo


People also ask

What is PWD in batch file?

$PWD means The current working directory as set by the cd command.

What is %~ dp0 in batch script?

The %~dp0 Variable. The %~dp0 (that's a zero) variable when referenced within a Windows batch file will expand to the drive letter and path of that batch file. The variables %0-%9 refer to the command line parameters of the batch file.

How do I echo a batch file?

To display the command prompt, type echo on. If used in a batch file, echo on and echo off don't affect the setting at the command prompt. To prevent echoing a particular command in a batch file, insert an @ sign in front of the command.


1 Answers

The simplest form:

SET CURRENTDIR="%cd%" 
like image 179
marapet Avatar answered Sep 28 '22 23:09

marapet