[tex-live] [off topic] question about a few details in windows bat files

Lars Madsen daleif at imf.au.dk
Wed Jan 26 16:33:37 CET 2011

Hi, sorry for the off topic question

We just had an issue with a .bat script we use to install SAS on 
students own laptops.

In the script my colleague (who like me is not a regular windows user) 
had written something similar to


this worked for most users, but on one Vista it failed. My colleague was 
  at a meeting so I had a go at it, it turned out that instead of 
getting the expected

ssd = <current dir>/SOMENAME

we were getting

ssd = c:/windows/system32/SOMENAME

and I remembered %~dp0 from the TL scripts, and

SET ssd=%~dp0/SOMENAME

worked fine

Now I'm wondering does anyone know why one need to use %~dp0 instead of 

We simple do not understand why %cd% workes on most Windows laptops but 
not all.



More information about the tex-live mailing list