a guest Jun 13th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- :::: -- Okay so it the loop finds a file such as C:\folder\path\g123.exe then the below will mean...
- set fakename=%%~NXa :: -- This is the file name only plus extension with no path (e.g. g123.exe)
- set realname=!fakename:~1! :: -- This is the file name only minus the first character ("g") on the left plus extension (e.g. 123.exe)
- %%~DP :: -- This expands to the drive letter and path only (e.g. C:\folder\path\)
- In the answer I put the below details to explain this but it can be confusing, these are for loop substituions
- In addition, substitution of FOR variable references has been enhanced. You can now use the following optional syntax:
- %~dI - expands %I to a drive letter only
- %~pI - expands %I to a path only
- %~nI - expands %I to a file name only
- %~xI - expands %I to a file extension only
RAW Paste Data