Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. setlocal EnableDelayedExpansion
  3. set file1=c:\windows\explorer.exe
  4. set file2=c:\windows\system32\ExplorerFrame.dll
  5. set file3=c:\windows\system32\shell32.dll
  6. set file4=c:\windows\system32\timedate.cpl
  7. set file5=c:\windows\system32\wucltux.dll
  8. set file6=c:\windows\system32\comdlg32.dll
  9. set file7=c:\windows\system32\appwiz.cpl
  10. set file8=
  11. set file9=
  12.  
  13. :: initiate var
  14. set count=7
  15.  
  16. :: Skip crap
  17. GOTO CRAP
  18.  
  19. :: count files and save to tempfile
  20. dir /b | find "." /c > %appdata%\tempfile.txt
  21.  
  22. :: tempfile to var
  23. set /p count=<%appdata%\tempfile.txt
  24.  
  25.  
  26. :CRAP
  27. echo Debug: Count = %count%
  28.  
  29. :: this batch files relies in the same dir as the files, substract 1
  30. set /a count=%count%-1
  31.  
  32. echo Debug: Count (-1) = %count%
  33. echo Debug: Will loop %count% times
  34. echo.
  35. for /L %%i IN (1,1,%count%) DO (
  36.     set var=file%%i
  37.     call set _result=%%!var!%%
  38.     echo file: !_result!
  39. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement