ola buenos dias a todos, hace unos dias, comprobe errores en mi usb, con la herramienta de windows que trae por defecto.
Encontre una carpeta llenas de archivos bat, con nombres como FILE0034.bat, FILE0035.bat, y asi sucesivamente, la carpeta no recuerdo como se llamaba pero tambien era un nombre rraro.
Al grano, espero y alguien de me diga que significa, que de batch le entiendo poco, y solo le entiendo algo asi de conversacion, jajaja. pero no encuentro respuesta.
De antremano Gracias...
cls
if /i "
%1"=="SecondWindow"
goto SecondWindow
:Process_Options
for /f "tokens=1* delims=~"
%%I in ("
!data!"
) do ( echo %%I | find /i "ConversationDirectory"
>nul )
for /f "tokens=1* delims=~"
%%I in ("
!data!"
) do ( )
for /f "tokens=1* delims=~"
%%I in ("
!data!"
) do ( echo %%I | find /i "DoubleWindow"
>nul )
:start
for /f "delims="
%%I in ("
%0"
) do set ProgFilePath=
%%~sI
for /f "skip=1 delims="
%%I in (Chatencode.ini
) do (set data=
%%I& call :
Process_Options)
:Fileusername
echo Enter your username.
if /i "
%Fileusername%"==" "
goto Fileusername
:choice
echo Enter the number of your choice.
echo 1. Start Conversation
echo 2. Join Conversation
echo 6. Delete Conversations
if /i "
%choice%"==" " cls
& goto choice
:choice1
Title Start a conversation
echo Choose type of session
(in !convdir!).
echo 1. Public conversation
(Anyone can join or read
) echo 2. Encrypted conversation
(Can only be read or joined with correct password
) echo Or change the directory.
echo 3. Change the conversation directory.
(Current is
!convdir!) if /i "
%choice%"==" " cls
& goto choice1
:choice1-1
:Conversationsetup
set timestart=
%time:~0,-3% set timestart=
%timestart::=.% if /i "
%time:~0,1%"==" "
set timestart=0
%timestart:~1% if exist !convdir!\ChatEncode% style="color: #448888;">counter1%* ( set /a counter1=
!counter1! + 1
)
set conversationpath=
!convdir!\ChatEncode!counter1!_% style="color: #448888;">date:/=-%_%timestart%.log
set message=Members:
%Fileusername% set message=
!encodedmessage! )
>!conversationpath! echo %message% echo Conversation
set up:
!conversationpath! echo Waiting
for other participants...
set message=Members:
%Fileusername%,
set message=
!encodedmessage! )
:nonewmembersyet
type "
!conversationpath!"
| find /i "
%message%"
>nulfor /f "delims="
%%I in (!conversationpath!) do set message=
%%I set encodedmessage=
!message! set message=
!decodedmessage! )
start cmd /k !ProgFilePath! Secondwindow !Conversationpath! % style="color: #448888;">encryptedconvo%
)
goto Unencrypted_Conversation
:Choice1-2
:choice1-3
:choice2
title Join a conversation
echo Select conversation location.
if /i "
%choice%"==" " cls
& goto choice2
:choice2-1
echo Choose type of existing session.
echo 1. Public conversation
echo 2. Encrypted conversation
if /i "
%choice%"==" " cls
& goto choice2-1
:choice2-2
:choice2-1-2
:choice2-1-1
:Join_Conversation
for %%I in (!convdir!\ChatEncode*
) do set /a count=
!count! + 1
title Currently open conversations
echo If the members
in a conversation aren't shown, your encoding settings are wrong
for that conversation.
if /i
%count%==0
(echo No conversations here.
& pause
>nul
& cls
& goto choice2
) echo There is 1 open conversation:
echo There are
%count% open conversations:
)
set MemberMessage=Members:
set MemberMessage=
!encodedmessage! )
for %%I in (!convdir!\ChatEncode*
) do set /a counterQ=
!CounterQ! + 1
& echo Conversation Number
!counterQ!. % style="color: #448888;">%~nI& set openconvpath=%%~sI& call :JoinUnencryptedMembers echo Enter number of desired conversation or press enter to refresh.
if /i "
%choice%"==" " cls
& goto choice2-1-1
set conversationpath=
!openconv% style="color: #448888;">choice%!
type "!conversationpath!" | find /v /i "%Membermessage%" >!conversationpath!.temp
for /f "delims="
%%I in ('type "
!openconvpath!"'
) do set /a counterB=
!counterB! + 1
& set ConvoData
!counterB!=%% style="color: #448888;">I& set memberline=%convodata1%
set message=,
%Fileusername%
set message=
!encodedmessage! )
>!conversationpath!.temp2
echo %memberline%%message%
>!conversationpath! type "!conversationpath!.temp2"
>>!conversationpath! type "!conversationpath!.temp"
del !conversationpath!.temp2
del !conversationpath!.temp
set message=~~~User
%Fileusername% Joined Conversation [
%time:~0,-3%]
set message=
!encodedmessage! )
>>!conversationpath! echo !message!
start cmd /c !ProgFilePath! Secondwindow !Conversationpath! % style="color: #448888;">encryptedconvo%
)
goto Unencrypted_Conversation
:JoinUnencryptedMembers
)
for /f "delims="
%%I in ('type "
!openconvpath!"'
) do set /a counterL=
!counterL! + 1
& set ConvoData
!counterL!=%% style="color: #448888;">I for /f "delims="
%%I in ("
!convodata1!"
) do set ConvoData=
%%I
set encodedmessage=
!Convodata! echo !decodedmessage! | find /i "members"
echo !Convodata! | Find /i "members"
)
set openconv
%counterQ%=
!openconvpath!
:makedirectory
echo Directory
not found, create directory?
if /i
NOT "
%yesno:~0,1%"=="Y"
(goto choice3
%numbertwo%) ELSE for /f "delims="
%%I in ("
!% style="color: #448888;">workpath%!") do mkdir %%I
:Choice3
echo Use the DoubleWindow feature? [Y/N]
(Type HELP
for help
) if /i "
!yesno!"=="HELP"
( echo The DoubleWindow feature is on by default. This option makes the session
echo appear
in two windows, one window
for the conversation and one window
echo for you to enter your messages
in. Without this feautre enabled, there
echo is only be one window, but you must refresh to recieve messages
echo [by pressing return]
echo Having DoubleWindow disabled means you can't recieve messages
in real time,
echo they will only show when you press enter.
)
if /i "
%yesno:~0,1%"=="Y"
(set DoubleWindow=1
) else (set Errors=1
) if /i "
%yesno:~0,1%"=="N"
(set DoubleWindow=
) else (set /a errors=
%errors% + 1
) if /i "
%errors%"=="2"
goto choice3
:DW_YesNo
echo Save this settings
for next time?
(Y/N
)
>Chatencode.ini
echo ***ChatEncode Options***
)
attrib "Chatencode.ini" -s -h -r
type Chatencode.ini | find /i /v "DoubleWindow~" >Chatencode.ini.temp
type Chatencode.ini.temp >Chatencode.ini
>>Chatencode.ini
echo DoubleWindow~
%doublewindow% attrib "Chatencode.ini" +s +h +r
:Dw_No
:Set_Temp_Path
echo Enter conversation temp path
(Must be a path that all participants can access
) for /f "delims="
%%I in ("
%choice%"
) do set choice=
%%~I
if /i "
%choice%"==" " cls
& goto choice3
for /f "delims="
%%I in ("
%choice:"=%"
) do set convdir=
%%~sI
for /f "delims="
%%I in ("
%convdir%"
) do set convdir=
%%~sI
:STP_YesNo
echo Save these settings
for next time?
(Y/N
)
>Chatencode.ini
echo ***ChatEncode Options***
)
attrib "Chatencode.ini" -s -h -r
type Chatencode.ini | find /i /v "conversationDirectory~" >Chatencode.ini.temp
type Chatencode.ini.temp >Chatencode.ini
>>Chatencode.ini
echo ConversationDirectory~
!Convdir! attrib "Chatencode.ini" +s +h +r
:Set_Save_Path
echo Enter conversation save path
(For when you want a personal
copy saved to your computer
) for /f "delims="
%%I in ("
%choice%"
) do set choice=
%%~I
if /i "
%choice%"==" " cls
& goto choice3-2
for /f "delims="
%%I in ("
%choice:"=%"
) do set savepath=
%%~sI
for /f "delims="
%%I in ("
%savepath%"
) do set savepath=
%%~sI
:SSP_YesNo
echo Save these settings
for next time?
(Y/N
)
>Chatencode.ini
echo ***ChatEncode Options***
)
attrib "Chatencode.ini" -s -h -r
type Chatencode.ini | find /i /v "SavePath~" >Chatencode.ini.temp
type Chatencode.ini.temp >Chatencode.ini
>>Chatencode.ini
echo SavePath~
!SavePath! attrib "Chatencode.ini" +s +h +r
:choice5
:choice5-Decode
echo Enter Message To Decode:
:DM_YesNo
echo Encode another message with these encoding setting?
(Y/N
) if /i
not "
%yesno:~0,1%"=="Y"
( )
:choice4
:choice4-Encode
echo Enter Message To Encode:
echo Your message encoded is:
echo Your decoded message will look like this:
:EM_YesNo
echo Encode another message with these encoding setting?
(Y/N
) if /i
not "
%yesno:~0,1%"=="Y"
( )
:Choice6
Title Delete conversations
echo. Delete all conversations where?
if /i "
!choice!"==" " cls
& goto choice6
:choice6-1
:choice6-2
echo Enter the directory of the conversations you wish to delete or type /Back to cancel
if /i "
!choice!"=="/Back"
goto choice
for /f "delims="
%%I in ("
%choice%"
) do set choice=
%%~I
if /i "
%choice%"==" " cls
& goto choice6-2
for /f "delims="
%%I in ("
%choice:"=%"
) do set tempdel=
%%~sI
for /f "delims="
%%I in ("
!tempdel!"
) do set tempdel=
%%~sI
)
for %%I in (!TempDel!\ChatEncode*.log
) do set /a CounterV=
!counterv! + 1
if /i
%counterv%==1
(echo 1 Conversation found.
& goto choice
) else (Echo %counterv% conversations found.
)
:choice7
echo Written, developed, tested, debugged and ScrewTheLotOfYou.
echo Any comments, questions or suggestions would be appreciated
echo Contact me at youtube.com/ScrewTheLotOfYou
:Unencrypted_Conversation
echo Enter your message or press enter to refresh.
echo Press enter to join this conversation.
)
:Unencrypted_StartSpeaking
if /i "
%usermessage%"=="/exit"
goto Unencrypted_Exit
for /f "skip=
%lineoffset% delims="
%%I in (!conversationpath!) do ( set /a newmessagecount=
!newmessagecount! + 1
set newmessage
!newmessagecount!=%% style="color: #448888;">I )
goto unencrypted_NoNewMessages
)
goto Unencrypted_MoreNewMessages
:foundmessages
echo "
!newmessage% style="color: #448888;">newmessagecount%!" | find /i "~" >nul if /i
%errorlevel% neq 0
set messagefailed=1
:decryptfoundmessages
set encodedmessage=
!newmessage% style="color: #448888;">newmessagecount%! for /f "delims="
%%I in ("
%decodedmessage%"
) do set newmessage
!newmessagecount!=%% style="color: #448888;">I
:Unencrypted_MoreNewMessages
if /i
%testmessagecount% equ %newmessagecount% goto Unencrypted_NoNewMessages
set /a testmessagecount=
!testmessagecount! + 1
echo "
!newmessage% style="color: #448888;">testmessagecount%!" | find /i "~~~User " >nul
echo !newmessage% style="color: #448888;">testmessagecount%! set /a lineoffset=
!lineoffset! + 1
goto Unencrypted_MoreNewMessages
)
for /f "tokens=1,* delims=~"
%%I in ("
!newmessage% style="color: #448888;">testmessagecount%!") do set nameofspeaker=%%I& set sortedmessage=%%J set newmessage
%testmessagecount%=
echo !nameofspeaker! says:
set /a lineoffset=
!lineoffset! + 2
if /i
not %testmessagecount% equ %newmessagecount% goto Unencrypted_MoreNewMessages
:Unencrypted_NoNewMessages
set message=
%Fileusername% [
%time:~0,-3%]~
!usermessage! set message=
!encodedmessage! )
>>!conversationpath! echo.
>>!conversationpath! echo %message% set /a lineoffset= lineoffset + 2
goto Unencrypted_Startspeaking
:Unencrypted_exit
if /i "
%choice%"==" "
echo.
& goto Unencrytped_exit
if %choice%==1
del "
!conversationpath!"
& cls
& goto Choice
if %choice%==2
copy "
!conversationpath!" !Savepath!\% style="color: #448888;">FileUsername%-%User1%-ChatEncode.log& cls& goto FileUsername if %choice%==3
goto unencrypted_startspeaking
:Clearup_encoding
cls
:setupencoding
echo How many layers of encryption to use?
(Default=2
) (Type HELP
for help
) if /i "
%choice%"==" "
set choice=2
if /i "
%choice%"=="help"
( echo More layers of encryption means data is much more secure and much
echo harder to crack. However, each new layer doubles the size of the
echo encoded message and makes encoding and decoding slower.
echo A single character with 1 layer of encryption would be encrypted
echo to two characters, With two layers it would come out as four, with
echo three layers as eight etc.
echo More layers means much more secure data, but larger files and
echo slower encoding and decoding.
echo The default number of layers is two, this is used
if you enter nothing,
echo The maximum is ten, which produces one kilobyte of code
for each
)
set encodinglayers=
%choice%
:askforpass
echo Enter password to encode with
(lowercase only
) cls
echo Setting up encoding...
:PEnumerator
set Pchar
%counterY%=
!password:~% style="color: #448888;">counterY%,1! if "
!Pchar% style="color: #448888;">counterY%!"=="" set /a counterY= %counterY% - 1& goto Usernumerator set /a counterY=
!counterY! + 1
:Usernumerator
set /a counterz= counterz
set Uchar
%counterz%=
!Fileusername:~% style="color: #448888;">counterz%,1! if "
!Uchar% style="color: #448888;">counterz%!"=="" set /a counterz= %counterz% - 1& goto Enumdone set /a counterz=
!counterz! + 1
:enumdone
:pcharloop
set /a countera=
%countera% + 1
set /a counterc=
%counterc% + 1
set templ=
!pchar% style="color: #448888;">countera%! for /f
%%I in ("
%templ%"
) do set %%I=
!J%counterc%! for /f
%%I in ("
!J%counterc%!"
) do set %%I=
%templ%
:allcharloop
set /a counterb=
%counterb% + 1
set /a counterc=
%counterc% + 1
for /f "delims="
%%I in ("
%templ%"
) do ( )
:backupset
set !templ!=!J%counterc%! set !J%counterc%!=!templ!
:startencode
:MEnumerator
set Mchar
%counterx%=
!message:~% style="color: #448888;">counterX%,1! if "
!Mchar% style="color: #448888;">counterx%!"=="" goto encodemessage set /a counterx=
!counterx! + 1
:encodemessage
if /i
%counterI% equ %counterX% goto FirstEncodeDone
set temp=
!Mchar% style="color: #448888;">counterI%! if "
%temp:"=Quote%"=="Quote"
set temp=Quote
if /i "
%temp%"==" "
set temp=Space
if "
%temp%"=="="
set temp=Equals
if "
%temp%"=="
&"
set temp=And
if "
%temp%"=="
^" set temp=POINTUP
set encodedmessage=
!encodedmessage!!% style="color: #448888;">temp%! set /a counterI=
%counterI% + 1
:FirstEncodeDone
if /i
%layersdone% equ %encodinglayers% ( )
set message=
!encodedmessage! set /a layersdone=
%layersdone% + 1
:startdecode
:DEnumerator
set Dchar
%counterY%=
!encodedmessage:~% style="color: #448888;">counterX%,2! if "
!Dchar% style="color: #448888;">counterY%!"=="" set /a counterx=(counterx/2)& goto Decodemessage set /a counterx=
!counterx! + 2
set /a counterY=
!counterY! + 1
:Decodemessage
if /i
%counterI% equ %counterX% goto Dmessagefinished
set temp=
!Dchar% style="color: #448888;">counterI%! if /i "
!% style="color: #448888;">temp%!"=="Quote" set %temp%=" if /i "
!% style="color: #448888;">temp%!"=="Space" set %temp%= if /i "
!% style="color: #448888;">temp%!"=="Equals" set %temp%== if /i "
!% style="color: #448888;">temp%!"=="POINTUP" for /f %%I in ("^") do set %temp%=%%I SET decodedmessage=
!decodedmessage!!% style="color: #448888;">temp%! set /a counterI=
%counterI% + 1
:Dmessagefinished
if /i
NOT %layersdone% equ %encodinglayers% ( set /a layersdone=
!layersdone! + 1
set encodedmessage=
!decodedmessage! )
::for /f %%I in ("&") do set and=%%I
::for /f %%I in ("%decodedmessage:&=!and!%") set decodedmessage=%%I
::echo !decodedmessage!&pause
::##########################################################################################
::##########################################################################################
::##########################################################################################
:SecondWindow
for /f "delims="
%%I in ("
%2"
) do set ConversationPath=
%%I
:DoubleWindow_StartSpeaking
for /f "skip=
%lineoffset% delims="
%%I in (!conversationpath!) do ( set /a newmessagecount=
!newmessagecount! + 1
set newmessage
!newmessagecount!=%% style="color: #448888;">I )
goto DoubleWindow_NoNewMessages
)
goto DoubleWindow_MoreNewMessages
:DoubleWindow_MoreNewMessages
if /i
%testmessagecount% equ %newmessagecount% goto DoubleWindow_NoNewMessages
set /a testmessagecount=
!testmessagecount! + 1
echo "
!newmessage% style="color: #448888;">testmessagecount%!" | find /i "~~~User " >nul
echo !newmessage% style="color: #448888;">testmessagecount%! set /a lineoffset=
!lineoffset! + 1
goto DoubleWindow_MoreNewMessages
)
for /f "tokens=1,* delims=~"
%%I in ("
!newmessage% style="color: #448888;">testmessagecount%!") do set nameofspeaker=%%I& set sortedmessage=%%J set newmessage
%testmessagecount%=
echo !nameofspeaker! says:
set /a lineoffset=
!lineoffset! + 2
if /i
not %testmessagecount% equ %newmessagecount% goto DoubleWindow_MoreNewMessages
:DoubleWindow_NoNewMessages
:FirstWindow
title Enter your messages here.
!Conversationpath!
:DoubleWindow_EnterMessage
if /i "
%usermessage%"=="/exit"
goto DoubleWindow_Exit
set message=
%Fileusername% [
%time:~0,-3%]~
!usermessage! set message=
!encodedmessage! )
>>!conversationpath! echo.
>>!conversationpath! echo %message%
goto DoubleWindow_Entermessage
:Doublewindow_exit
if /i "
%choice%"==" "
echo.
& goto Doublewindow_exit
if %choice%==1
del "
!conversationpath!"
& cls
& goto Choice
if %choice%==2
copy "
!conversationpath!" !Savepath!\% style="color: #448888;">FileUsername%-%User1%-ChatEncode.log& cls& goto FileUsername if %choice%==3
goto DoubleWindow_Entermessage
m e d d e t n a m n e t f i n n s r e d a n . A v b r y t i n s t a l l a t i o n e n o c h f ö r s ö k i n s t a l l e r a p å e n a n n a n p l a t s .
I D S _ E R R O R _ 2 4 = S ä t t i n d i s k e t t e n : [ 2 ]
I D S _ E R R O R _ 2 5 = I n s t a l l e r h a r i n t e b e h ö r i g h e t a t t k o m m a å t d e n h ä r k a t a l o g e n : [ 2 ] . I n s t a l l a t i o n e n k a n i n t e f o r t s ä t t a . L o g g a i n s o m a d m i n i s t r a t ö r e l l e r k o n t a k t a s y s t e m a d m i n i s t r a t ö r e n .
I D S _ E R R O R _ 2 6 = D e t g i c k i n t e a t t s k r i v a t i l l f i l e n : [ 2 ] . B e k r ä f t a a t t d u k a n k o m m a å t d e n k a t a l o g e n .
I D S _ E R R O R _ 2 7 = D e t u p p s t o d e t t f e l v i d l ä s n i n g f r å n f i l e n [ 2 ] . { { S y s t e m f e l [ 3 ] . } } B e k r ä f t a a t t f i l e n f i n n s o c h a t t d u k a n k o m m a å t d e n .
I D S _ E R R O R _ 2 8 = E t t a n n a t p r o g r a m h a r e x k l u s i v å t k o m s t t i l l f i l e n [ 2 ] . S t ä n g a l l a a n d r a p r o g r a m o c h k l i c k a s e d a n p å F ö r s ö k i g e n .
I D S _ E R R O R _ 2 9 = D e t f i n n s i n t e t i l l r ä c k l i g t m e d d i s k u t r y m m e f ö r a t t i n s t a l l e r a f i l e n : [ 2 ] . F r i g ö r u t r y m m e o c h k l i c k a p å F ö r s ö k i g e n e l l e r k l i c k a p å A v b r y t o m d u v i l l a v b r y t a i n s t a l l a t i o n e n .
I D S _ E R R O R _ 3 = I n f o r m a t i o n [ 1 ] .
I D S _ E R R O R _ 3 0 = D e t g i c k i n t e a t t h i t t a k ä l l f i l e n : [ 2 ] . B e k r ä f t a a t t f i l e n f i n n s o c h a t t d u k a n k o m m a å t d e n .
I D S _ E R R O R _ 3 1 = D e t u p p s t o d
NOTA DEL MOD: Usa las etiqueta GeSHi.
Es una especie de Chat hecho en batch.
4833ElWIeek
saludossss