|
Answer» Hi there!
I have a batch file where I GIVE a file name with full path (like C:\Windows\System32\argelbargel.dll) as parameter (%1) and I need to 'extract' the path from it (for use, not just to remove it). Giving the path as additional parameter is not an option in this case.
Possibly this is an easy one, I don't know. It's my first batch file in years. Maybe there is ALREADY a SOLUTION in the forum but the search didn't bring it up (actually I don't know what keywords would lead me there. I tried, believe me).
EDIT: Crap. I forgot the OS specs. Win XP or Win2003, has to run on both.Without an OS I can only imagine a solution.
On some machines this might work:
CODE: [SELECT]set dirname=%~d1%~p1% echo %dirname% 8-)I tried it and it works. Thanks!
|