daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :::: -- Okay so it the loop finds a file such as C:\folder\path\g123.exe then the below will mean...
  2. set fakename=%%~NXa        :: -- This is the file name only plus extension with no path (e.g. g123.exe)
  3. set realname=!fakename:~1! :: -- This is the file name only minus the first character ("g") on the left plus extension (e.g. 123.exe)
  4. %%~DP :: -- This expands to the drive letter and path only (e.g. C:\folder\path\)
  5.  
  6.                      
  7. In the answer I put the below details to explain this but it can be confusing, these are for loop substituions
  8.  
  9. In addition, substitution of FOR variable references has been enhanced. You can now use the following optional syntax:
  10.  
  11. %~dI        - expands %I to a drive letter only
  12. %~pI        - expands %I to a path only
  13. %~nI        - expands %I to a file name only
  14. %~xI        - expands %I to a file extension only
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top