Tech News
← Home  ·  All topics

Pushd

1 GoKawiil brief on this topic

Windows Explorer sets current directory on double-click, batch files don't

A developer reported that a program failed with an error when launched from a batch file but ran fine when double-clicked in Windows Explorer. Microsoft's Raymond Chen explained that Explorer automatically sets the current working directory to the folder containing the launched file, while a batch file calling the program by full path does not change the directory at all. The customer fixed the issue by using pushd and popd commands to set and restore the working directory within the batch file.