Go Back   Computer Forums > General Computing > Software and Operating Systems
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 10-04-2012, 09:28 PM   #1
In Runtime
 
WYSIWUG's Avatar
 
Join Date: Aug 2012
Location: New Zelaland
Posts: 381
Default What will this Batch File do?

@ECHO OFF
IF EXIST Files.txt DEL Files.txt
IF EXIST OutFile.txt DEL OutFile.txt
FOR /F %%F IN ('"DIR /B *.txt | FIND /V /C "::""') DO SET /A Number=(%Random% %%%%F)
SET DONE==N
IF %Number%==0 GOTO No_Skip
FOR /F "SKIP=%Number%" %%D IN ('"DIR /B *.txt | FIND /V "::""') DO ECHO %%D >>Files.txt
FOR /F "TOKENS=*" %%L IN (Files.txt) DO CALL :1 %%L
GOTO Next
:1
IF %DONE%==Y GOTO :eof
ECHO %*>OutFile.txt
SET DONE=Y
GOTO :eof

:No_Skip
FOR /F %%D IN ('"DIR /B *.txt | FIND /V "::""') DO ECHO %%D>>Files.txt
FOR /F "TOKENS=*" %%L IN (Files.txt) DO CALL :2 %%L
GOTO Next
:2
IF %DONE%==Y GOTO :eof
ECHO %*>OutFile.txt
SET DONE=Y
GOTO :eof
:Next
FOR /F %%Z IN (OutFile.txt) DO SET File=%%Z
ECHO TYPE C:\Thoughts\%File%
IF EXIST OutFile.txt DEL OutFile.txtIF EXIST Files.txt DEL Files.txt
__________________
I hope that the world runs out of oil today so we can build a world free of hate and greed and money. Build one based on love and respect for all forms of life.
WYSIWUG is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 03:37 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0