Guest User

Untitled

a guest
Nov 11th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. dir /b /s /a:-D > results.txt
  2.  
  3. C:UsersMartinPicturesTableoriginalPC120013.JPG 227298
  4. C:UsersMartinPicturesTableoriginalPC120014.JPG 123234
  5. C:UsersMartinPicturesTableoriginalPC120015.JPG 932344
  6.  
  7. @echo off & for /f %a in ('dir /s /b') do echo %~fa %~za
  8.  
  9. In addition, substitution of FOR variable references has been enhanced.
  10. You can now use the following optional syntax:
  11.  
  12. %~I - expands %I removing any surrounding quotes (")
  13. %~fI - expands %I to a fully qualified path name
  14. %~dI - expands %I to a drive letter only
  15. %~pI - expands %I to a path only
  16. %~nI - expands %I to a file name only
  17. %~xI - expands %I to a file extension only
  18. %~sI - expanded path contains short names only
  19. %~aI - expands %I to file attributes of file
  20. %~tI - expands %I to date/time of file
  21. %~zI - expands %I to size of file
  22. %~$PATH:I - searches the directories listed in the PATH
  23. environment variable and expands %I to the
  24. fully qualified name of the first one found.
  25. If the environment variable name is not
  26. defined or the file is not found by the
  27. search, then this modifier expands to the
  28. empty string
  29.  
  30. The modifiers can be combined to get compound results:
  31.  
  32. %~dpI - expands %I to a drive letter and path only
  33. %~nxI - expands %I to a file name and extension only
  34. %~fsI - expands %I to a full path name with short names only
  35. %~dp$PATH:I - searches the directories listed in the PATH
  36. environment variable for %I and expands to the
  37. drive letter and path of the first one found.
  38. %~ftzaI - expands %I to a DIR like output line
  39.  
  40. @echo off & for /R "c:deletelaterfolder with spaces" %A in (*.*) do echo %~fA %~zA
  41.  
  42. @echo off & for /R "c:deletelater" %A in (*.*) do echo %~fA %~zA
  43. c:DeleteLaterName with Spaces.txt 19800676
  44. c:DeleteLaterNoSpacesLongName.txt 21745440
  45. c:DeleteLaterFolder with Spaces2nd Name with Spaces.txt 5805492
  46. c:DeleteLaterFolder with Spaces2ndNoSpacesLongName.txt 3870322
  47. c:DeleteLaterFolderNoSpaces3rd Name with Spaces.txt 27874695
  48. c:DeleteLaterFolderNoSpaces3rdNoSpacesLongName.txt 28726032
  49.  
  50. @echo off & for /f "delims=*" %A in ('dir /s /b') do echo %~fA %~zA
  51.  
  52. @echo Results on %DATE% for %CD% >> YourDirFile.txt & echo off & for /f "delims=*" %A in ('dir /s /b /a:-d') do echo %~fA %~zA >> YourDirFile.txt
  53.  
  54. @echo off & for /f %A in ('dir /s /b /a:-d') do echo %~zA %~fA %~zA
  55. C:DeleteLaterName
  56. 21745440 C:DeleteLaterNoSpacesLongName.txt 21745440
  57. C:DeleteLaterFolder
  58. C:DeleteLaterFolder
  59. C:DeleteLaterFolderNoSpaces3rd
  60. 28726032 C:DeleteLaterFolderNoSpaces3rdNoSpacesLongName.txt 28726032
  61.  
  62. @echo off & for /f "delims=*" %A in ('dir /s /b /a:-d') do echo %~fA %~zA
  63. C:DeleteLaterName with Spaces.txt 19800676
  64. C:DeleteLaterNoSpacesLongName.txt 21745440
  65. C:DeleteLaterFolder with Spaces2nd Name with Spaces.txt 5805492
  66. C:DeleteLaterFolder with Spaces2ndNoSpacesLongName.txt 3870322
  67. C:DeleteLaterFolderNoSpaces3rd Name with Spaces.txt 27874695
  68. C:DeleteLaterFolderNoSpaces3rdNoSpacesLongName.txt 28726032
  69.  
  70. FORFILES /S /M *.doc /C "cmd /c echo @fsize"
  71. FORFILES /M *.txt /C "cmd /c if @isdir==FALSE notepad.exe @file"
  72.  
  73. forfiles /s /c "cmd /c if @isdir==FALSE echo @path @fsize" >>ForfilesOut.txt
  74.  
  75. forfiles /s /c "cmd /c if @isdir==FALSE echo @path @fsize"
  76.  
  77. "c:DeleteLaterName with Spaces.txt" 19800676
  78. "c:DeleteLaterNoSpacesLongName.txt" 21745440
  79. "c:DeleteLaterFolder with Spaces2nd Name with Spaces.txt" 5805492
  80. "c:DeleteLaterFolder with Spaces2ndNoSpacesLongName.txt" 3870322
  81. "c:DeleteLaterFolderNoSpaces3rd Name with Spaces.txt" 27874695
  82. "c:DeleteLaterFolderNoSpaces3rdNoSpacesLongName.txt" 28726032
  83. "c:DeleteLaterMoreFilesA really really long file name that goes on and on 123456789 asdfghjkl zxcvnm qwertyuiop and still A really really long file name that goes on and on 123456789 qwertyuiop and still further roughly 225 characters by now.txt" 447
  84. "c:DeleteLaterMoreFilesNew Text Document no extension" 0
  85.  
  86. sfk cwd +run -yes "sfk list -size -tab $qfile +toclip"
  87.  
  88. sfk fromclip > C:_tempsfk_list_output.txt
  89.  
  90. (for /R "pathtodirectory" %A in (*.*) do echo %~fA %~zA) | findstr /v "echo"
  91.  
  92. D:UsersNatasha>(for /R "." %A in (*.*) do echo %~fA %~zA) | findstr /v "echo"
  93.  
  94.  
  95. D:UsersNatashaFlowers_ (12).jpg 118886
  96.  
  97. D:UsersNatashaSomeFolderdata.txt 1241
  98.  
  99. D:UsersNatashaSomeFolderCSCounter-Strike_1.6.exe 272645624
  100.  
  101. du -ah "C:your_dir" > "C:file_list.txt"
  102.  
  103. 15 C:your_dir/.htaccess
  104. 608 C:your_dir/folder/hello.txt
  105. 1.0 C:your_dir/folder/subfolder/test.txt
  106. 1.0 C:your_dir/folder/subfolder
  107. 1.2M C:your_dir/folder/world.txt
  108. 1.2M C:your_dir/folder
  109. 9.0 C:your_dir/no_file_ending
  110. 11 C:your_dir/sample document 1.txt
  111. 684K C:your_dir/sample document 2 - äöüßÄÖÜáà.txt
  112. 1.9M C:your_dir
Add Comment
Please, Sign In to add comment