How can I get the current working directory and get the path without the drive letter for instance:
C:\testing\test\test
I would like to get in a variable
testing\test\test
How can I trim the drive letter? I can get the full path using
set fullPath = %CD%
I can't use the %~d0 notation as it gives me the path of my script versus the actual working directory I'm in
Check out the following link:
set fullPath=%cd:~3%
echo %fullPath%
http://blogs.msdn.com/b/oldnewthing/archive/2005/01/28/362565.aspx
%cd:~3%
eg:
C:\testing\test\test>echo %cd:~3%
testing\test\test
C:\testing\test\test>
DOS string manipulations, here:
http://www.dostips.com/DtTipsStringManipulation.php#Snippets.MidString
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With