Alguna Idea de este codigo batch??

Iniciado por xBart, 16 Abril 2011, 18:39 PM

0 Miembros y 1 Visitante están viendo este tema.

xBart

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...

Código (dos) [Seleccionar]
cls
@echo off
setlocal enabledelayedexpansion
if /i "%1"=="SecondWindow" goto SecondWindow
goto Start

:Process_Options
for /f "tokens=1* delims=~" %%I in ("!data!") do (
echo %%I | find /i "ConversationDirectory" >nul
if /i !errorlevel!==0 set Convdir=%%J& exit /b
)

for /f "tokens=1* delims=~" %%I in ("!data!") do (
echo %%I | find /i "SavePath" >nul
if /i !errorlevel!==0 set SavePath=%%J& exit /b
)

for /f "tokens=1* delims=~" %%I in ("!data!") do (
echo %%I | find /i "DoubleWindow" >nul
if /i !errorlevel!==0 set DoubleWindow=%%J& exit /b
)


:start
for /f "delims=" %%I in ("%0") do set ProgFilePath=%%~sI
if not exist chatencode.ini set DoubleWindow=1& goto Fileusername

set counterE=0
for /f "skip=1 delims=" %%I in (Chatencode.ini) do (set data=%%I& call :Process_Options)

:Fileusername

title ChatEncode

set Fileusername=
echo Enter your username.
set /p Fileusername=
if not defined Fileusername cls& goto Fileusername
if /i "%Fileusername%"==" " goto Fileusername


:choice
title ChatEncode
echo.
echo Enter the number of your choice.
echo.
echo 1. Start Conversation
echo 2. Join Conversation
echo 3. Options
echo 4. Single Encode
echo 5. Single Decode
echo 6. Delete Conversations
echo 7. Credits
set choice=
set /p choice=
if not defined choice cls& goto choice
if /i "%choice%"==" " cls& goto choice
set choice=%choice:~0,1%
if /i not %choice% geq 1 cls& goto choice
if /i not %choice% leq 7 cls& goto choice

goto choice%choice%















:choice1
Title Start a conversation
echo.
echo.
echo.
echo Choose type of session (in !convdir!).
echo.
echo 1. Public conversation (Anyone can join or read)
echo 2. Encrypted conversation (Can only be read or joined with correct password)
echo.
echo Or change the directory.
echo 3. Change the conversation directory. (Current is !convdir!)
set choice=
set /p choice=
echo.
if not defined choice cls& goto choice1
if /i "%choice%"==" " cls& goto choice1
set choice=%choice:~0,1%
if /i not %choice% geq 1 cls& goto choice1
if /i not %choice% leq 3 cls& goto choice1
goto choice1-%choice%


:choice1-1

:Conversationsetup
set /a counter1=counter1
set timestart=%time:~0,-3%
set timestart=%timestart::=.%
if /i "%time:~0,1%"==" " set timestart=0%timestart:~1%
if exist !convdir!\ChatEncode%counter1%* (
set /a counter1= !counter1! + 1
goto conversationsetup
)

set conversationpath=!convdir!\ChatEncode!counter1!_%date:/=-%_%timestart%.log

set message=Members: %Fileusername%
if defined encryptedconvo (
set encodedmessage=
call :startencode
set message=!encodedmessage!
set encodedmessage=
)

>!conversationpath! echo %message%
title !Conversationpath!
echo.
echo.
echo Conversation set up: !conversationpath!
echo.
echo.
echo Waiting for other participants...

set message=Members: %Fileusername%,

if defined encryptedconvo (
set encodedmessage=
call :startencode
set message=!encodedmessage!
set encodedmessage=
)

:nonewmembersyet
type "!conversationpath!" | find /i "%message%" >nul
if %errorlevel% neq 0 goto nonewmembersyet
set tokenoffset=3
set usernumber=2
for /f "delims=" %%I in (!conversationpath!) do set message=%%I
if defined encryptedconvo (
set decodedmessage=
set encodedmessage=!message!
call :startdecode
set message=!decodedmessage!
)
echo.
echo.
echo.
echo %message%

if defined DoubleWindow (
start cmd /k !ProgFilePath! Secondwindow !Conversationpath! %encryptedconvo%
goto FirstWindow
)
goto Unencrypted_Conversation





:Choice1-2
call :setupencoding
set EncryptedConvo=1
goto conversationsetup


:choice1-3
call :Set_Temp_Path
goto choice1






:choice2
title Join a conversation
echo.
echo.
echo Select conversation location.
echo.
echo 1. !convdir!
echo 2. Other
set choice=
set /p choice=
echo.
if not defined choice cls& goto choice2
if /i "%choice%"==" " cls& goto choice2
set choice=%choice:~0,1%
if /i not %choice% geq 1 cls& goto choice2
if /i not %choice% leq 2 cls& goto choice2
goto choice2-%choice%


:choice2-1
echo.
echo.
echo Choose type of existing session.
echo.
echo 1. Public conversation
echo 2. Encrypted conversation
echo.
set choice=
set /p choice=
echo.
if not defined choice cls& goto choice2-1
if /i "%choice%"==" " cls& goto choice2-1
set choice=%choice:~0,1%
if /i not %choice% geq 1 cls& goto choice2-1
if /i not %choice% leq 2 cls& goto choice2-1
goto choice2-1-%choice%

:choice2-2
call :Set_Temp_Path
goto choice2-1

:choice2-1-2
call :setupencoding
set EncryptedConvo=1
goto join_conversation


:choice2-1-1
set encryptedconvo=


:Join_Conversation
setlocal enabledelayedexpansion
set counterQ=0
set count=0
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.
echo.

if /i %count%==0 (echo No conversations here.& pause>nul& cls& goto choice2)
if /i %count%==1 (
echo There is 1 open conversation:
echo.
) else (
echo There are %count% open conversations:
echo.
)


set MemberMessage=Members:
if defined encryptedconvo (
set message=Members:
set encodedmessage=
call :startencode
set MemberMessage=!encodedmessage!
set encodedmessage=
)
for %%I in (!convdir!\ChatEncode*) do set /a counterQ= !CounterQ! + 1& echo Conversation Number !counterQ!. %%~nI& set openconvpath=%%~sI& call :JoinUnencryptedMembers
echo.
echo.
echo Enter number of desired conversation or press enter to refresh.
echo.
set choice=
set /p choice=
echo.

if not defined choice cls& goto choice2-1-1
if /i "%choice%"==" " cls& goto choice2-1-1
set choice=%choice:~0,1%
if /i not %choice% geq 1 cls& goto choice2-1
if /i not %choice% leq %counterQ% cls& goto choice2-1-1
set conversationpath=!openconv%choice%!

set skipthisone=1
type "!conversationpath!" | find /v /i "%Membermessage%" >!conversationpath!.temp

set counterB=0
for /f "delims=" %%I in ('type "!openconvpath!"') do set /a counterB= !counterB! + 1& set ConvoData!counterB!=%%I& set memberline=%convodata1%

set message=, %Fileusername%

if defined encryptedconvo (
set encodedmessage=
call :startencode
set message=!encodedmessage!
set encodedmessage=
)

>!conversationpath!.temp2 echo %memberline%%message%

set memberline=
set message=

>!conversationpath! type "!conversationpath!.temp2"
>>!conversationpath! type "!conversationpath!.temp"

del !conversationpath!.temp2
del !conversationpath!.temp
set message=~~~User %Fileusername% Joined Conversation [%time:~0,-3%]

if defined encryptedconvo (
set encodedmessage=
call :startencode
set message=!encodedmessage!
set encodedmessage=
)
>>!conversationpath! echo !message!

if defined DoubleWindow (
start cmd /c !ProgFilePath! Secondwindow !Conversationpath! %encryptedconvo%
goto FirstWindow
)

goto Unencrypted_Conversation


:JoinUnencryptedMembers
if defined encryptedconvo (
set decodedmessage=
set encodedmessage=
)

set CounterL=0

for /f "delims=" %%I in ('type "!openconvpath!"') do set /a counterL= !counterL! + 1& set ConvoData!counterL!=%%I
for /f "delims=" %%I in ("!convodata1!") do set ConvoData=%%I

if defined encryptedconvo (
set encodedmessage=!Convodata!
set decodedmessage=
call :startdecode
echo !decodedmessage! | find /i "members"
set decodedmessage=
) ELSE (
echo !Convodata! | Find /i "members"
)


echo.
set openconv%counterQ%=!openconvpath!
exit /b





















:makedirectory
echo Directory not found, create directory?
set /p yesno=
echo.
if not defined yesno goto makedirectory
if /i NOT "%yesno:~0,1%"=="Y" (goto choice3%numbertwo%) ELSE for /f "delims=" %%I in ("!%workpath%!") do mkdir %%I
exit /b


:Choice3
title Options
echo.
echo.
echo Use the DoubleWindow feature? [Y/N] (Type HELP for help)
set yesno=
set /p yesno=
if not defined yesno goto :choice3
if /i "!yesno!"=="HELP" (
echo.
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.
goto choice3
)


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)
set /p yesno=
echo.

if not defined yesno goto DW_YesNo
if /i "%yesno:~0,1%" neq "Y" goto DW_No

if not exist ChatEncode.ini (
>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
del Chatencode.ini.temp

>>Chatencode.ini echo.
>>Chatencode.ini echo DoubleWindow~%doublewindow%
attrib "Chatencode.ini" +s +h +r
echo Options Saved.




:Dw_No



call :Set_Temp_Path

echo.

call :Set_Save_Path

for /l %%I in (1,1,10) do echo.

goto choice
















:Set_Temp_Path
echo.
echo.
echo Enter conversation temp path (Must be a path that all participants can access)
echo.
set choice=
set /p choice=
echo.
for /f "delims=" %%I in ("%choice%") do set choice=%%~I
if not defined choice cls& goto choice3
if /i "%choice%"==" " cls& goto choice3
for /f "delims=" %%I in ('echo "%choice%"') do set choice=%%I
for /f "delims=" %%I in ("%choice:"=%") do set convdir=%%~sI
for /f "delims=" %%I in ("%convdir%") do set convdir=%%~sI
set workpath=Convdir
set numbertwo=
if not exist !convdir! (call :makedirectory)
echo Directory Assigned.

:STP_YesNo

echo Save these settings for next time? (Y/N)
set /p yesno=
echo.
if not defined yesno goto STP_YesNo
if /i not "%yesno:~0,1%"=="Y" (exit /b)

if not exist ChatEncode.ini (
>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
del Chatencode.ini.temp

>>Chatencode.ini echo.
>>Chatencode.ini echo ConversationDirectory~!Convdir!
attrib "Chatencode.ini" +s +h +r
echo Options Saved.


exit /b


:Set_Save_Path
echo Enter conversation save path (For when you want a personal copy saved to your computer)
echo.
set choice=
set /p choice=
echo.
for /f "delims=" %%I in ("%choice%") do set choice=%%~I
if not defined choice cls& goto choice3-2
if /i "%choice%"==" " cls& goto choice3-2
for /f "delims=" %%I in ('echo "%choice%"') do set choice=%%I
for /f "delims=" %%I in ("%choice:"=%") do set savepath=%%~sI
for /f "delims=" %%I in ("%savepath%") do set savepath=%%~sI
set workpath=Savepath
set numbertwo=-2
if not exist !savepath! (call :makedirectory)
echo Directory Assigned.


:SSP_YesNo

echo Save these settings for next time? (Y/N)
set /p yesno=
echo.
if not defined yesno goto SSP_YesNo
if /i not "%yesno:~0,1%"=="Y" (exit /b)

if not exist ChatEncode.ini (
>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
del Chatencode.ini.temp

>>Chatencode.ini echo.
>>Chatencode.ini echo SavePath~!SavePath!
attrib "Chatencode.ini" +s +h +r
echo Options Saved.



exit /b














:choice5
title Decode Message
call :setupencoding
set countera=-1
set counterc=-1

:choice5-Decode
echo Enter Message To Decode:
set encodedmessage=
set /p encodedmessage=
echo.
echo Decoded message:
echo.
set decodedmessage=
call :Startdecode
echo "%decodedmessage%"
echo.
echo.
echo.
echo.
echo.
echo.
:DM_YesNo
echo Encode another message with these encoding setting? (Y/N)
set yesno=
set /p yesno=
echo.
if not defined yesno goto DM_YesNo
if /i not "%yesno:~0,1%"=="Y" (
call :clearup_encoding
)
goto Choice5-Decode
















:choice4
Title Encode Message
set countera=-1
set counterc=-1
call :setupencoding
echo Encoding Ready!

:choice4-Encode
echo.
echo.
echo Enter Message To Encode:
set message=
set /p message=
echo.
echo.
echo.
set encodedmessage=
call :startencode
echo Your message encoded is:
echo.
echo %encodedmessage%
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause
echo.
echo.
echo.
echo Your decoded message will look like this:
echo.
set decodedmessage=
call :Startdecode
echo "%decodedmessage%"
echo.
echo.
echo.
echo.
echo.
echo.
:EM_YesNo
echo Encode another message with these encoding setting? (Y/N)
set /p yesno=
echo.
if not defined yesno goto EM_YesNo
if /i not "%yesno:~0,1%"=="Y" (
call :clearup_encoding
)
goto Choice4-Encode






:Choice6
Title Delete conversations
echo. Delete all conversations where?
echo.
echo 1. !Convdir!
echo 2. Other
echo.
echo 3. Return to menu
set choice=
set /p choice=
echo.
if not defined choice cls& goto choice6
if /i "!choice!"==" " cls& goto choice6
set choice=!choice:~0,1!
if /i not !choice! geq 1 cls& goto choice6
if /i not !choice! leq 3 cls& goto choice6

if /i !choice! equ 3 goto Choice

goto choice6-%choice%

:choice6-1
for %%I in (!Convdir!\ChatEncode*) do echo Deleting %%I& del %%I
goto choice


:choice6-2
echo.
echo Enter the directory of the conversations you wish to delete or type /Back to cancel
set /p choice=
echo.
if /i "!choice!"=="/Back" goto choice

for /f "delims=" %%I in ("%choice%") do set choice=%%~I
if not defined choice cls& goto choice6-2
if /i "%choice%"==" " cls& goto choice6-2
for /f "delims=" %%I in ('echo "%choice%"') do set choice=%%I
for /f "delims=" %%I in ("%choice:"=%") do set tempdel=%%~sI
for /f "delims=" %%I in ("!tempdel!") do set tempdel=%%~sI

if NOT exist !tempdel! echo Directory does not exist.& goto choice6
)
set CounterV=0
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.)
for %%I in (!TempDel!\ChatEncode*.log) do echo Deleting %%I& del %%I

goto choice



:choice7
echo Written, developed, tested, debugged and ScrewTheLotOfYou.
echo Any comments, questions or suggestions would be appreciated
echo Contact me at youtube.com/ScrewTheLotOfYou
pause
goto Choice






:Unencrypted_Conversation
title !Conversationpath!
set lineoffset=2
echo Enter your message or press enter to refresh.
echo Enter /Exit to quit.
if defined skipthisone (
echo Press enter to join this conversation.
set skipthisone=
)
for /L %%I in (1,1,21) do echo.


:Unencrypted_StartSpeaking

set gotnewmsg=
set newmessagecount=0
set testmessagecount=0
set usermessage=

set /p usermessage=

if defined usermessage echo.

if not exist !conversationpath! cls& echo Conversation Deleted...& pause& goto choice
if /i "%usermessage%"=="/exit" goto Unencrypted_Exit
for /f "skip=%lineoffset% delims=" %%I in (!conversationpath!) do (
set /a newmessagecount= !newmessagecount! + 1
set newmessage!newmessagecount!=%%I
call :foundmessages
)

if messagefailed==1 (
set messagefailed=
goto unencrypted_NoNewMessages
)
goto Unencrypted_MoreNewMessages

:foundmessages
if defined encryptedconvo call :decryptfoundmessages
echo "!newmessage%newmessagecount%!" | find /i "~" >nul
if /i %errorlevel% neq 0 set messagefailed=1
exit /b

:decryptfoundmessages
set encodedmessage=
set encodedmessage=!newmessage%newmessagecount%!
set decodedmessage=
call :startdecode
for /f "delims=" %%I in ("%decodedmessage%") do set newmessage!newmessagecount!=%%I
exit /b




:Unencrypted_MoreNewMessages
if /i %testmessagecount% equ %newmessagecount% goto Unencrypted_NoNewMessages
set /a testmessagecount= !testmessagecount! + 1

echo "!newmessage%testmessagecount%!" | find /i "~~~User " >nul

if /i !errorlevel! equ 0 (
echo !newmessage%testmessagecount%!
set /a lineoffset= !lineoffset! + 1
goto Unencrypted_MoreNewMessages
)

for /f "tokens=1,* delims=~" %%I in ("!newmessage%testmessagecount%!") do set nameofspeaker=%%I& set sortedmessage=%%J
set newmessage%testmessagecount%=
echo !nameofspeaker! says:
echo !sortedmessage:~1!
echo.
set /a lineoffset=!lineoffset! + 2
if /i not %testmessagecount% equ %newmessagecount% goto Unencrypted_MoreNewMessages

:Unencrypted_NoNewMessages

if not defined usermessage goto Unencrypted_StartSpeaking

set message=%Fileusername% [%time:~0,-3%]~ !usermessage!
if defined encryptedconvo (
set encodedmessage=
call :startencode
set message=!encodedmessage!
set encodedmessage=
)
>>!conversationpath! echo.
>>!conversationpath! echo %message%
set /a lineoffset= lineoffset + 2

goto Unencrypted_Startspeaking


:Unencrypted_exit
Echo Choose Option:
echo 1. Exit and delete conversation
echo 2. Exit and save conversation
echo 3. Resume
set choice=
set /p choice=
if not defined choice echo.& goto Unencrytped_exit
if /i "%choice%"==" " echo.& goto Unencrytped_exit
set choice=%choice:~0,1%
if /i not %choice% geq 1 echo.& goto Unencrytped_exit
if /i not %choice% leq 3 echo.& goto Unencrytped_exit

if %choice%==1 del "!conversationpath!"& cls& goto Choice
if %choice%==2 copy "!conversationpath!" !Savepath!\%FileUsername%-%User1%-ChatEncode.log& cls& goto FileUsername
if %choice%==3 goto unencrypted_startspeaking


















:Clearup_encoding
set seconddecode=
set encodedmessage=
set decodedmessage=
set counterI=
set countery=
set counterz=
set counterx=
set second_encode=
for /L %%I in (0,1,257) do for /f %%K in ("!L%%I!") do set %%K=
cls
goto choice






















:setupencoding
echo How many layers of encryption to use? (Default=2) (Type HELP for help)
echo.
set choice=
set /p choice=
echo.
if not defined choice set choice=2
if /i "%choice%"==" " set choice=2
if /i "%choice%"=="help" (
echo.
echo.
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
echo character.
echo.
echo.
goto setupencoding
)
set choice=%choice:~0,2%
if /i not %choice% geq 1 set choice=2
if /i not %choice% leq 10 set choice=2
set encodinglayers=%choice%

:askforpass
echo Enter password to encode with (lowercase only)
set password=
set /p password=""
echo.
if not defined password cls& goto askforpass
cls



set choice=
echo Setting up encoding...
echo.
echo.
echo.


set countery=0
:PEnumerator
set Pchar%counterY%=!password:~%counterY%,1!
if "!Pchar%counterY%!"=="" set /a counterY= %counterY% - 1& goto Usernumerator
set /a counterY= !counterY! + 1
goto Penumerator

:Usernumerator
set /a counterz= counterz
set Uchar%counterz%=!Fileusername:~%counterz%,1!
if "!Uchar%counterz%!"=="" set /a counterz= %counterz% - 1& goto Enumdone
set /a counterz= !counterz! + 1
goto Usernumerator


:enumdone
for /f %%I in ("(") do set L0=%%I
for /f %%I in (")") do set L1=%%I
for /f %%I in ("*") do set L2=%%I
for /f %%I in ("+") do set L3=%%I
for /f %%I in (",") do set L4=%%I
for /f %%I in ("-") do set L5=%%I
for /f %%I in (".") do set L6=%%I
for /f %%I in ("/") do set L7=%%I
for /f %%I in ("0") do set L8=%%I
for /f %%I in ("1") do set L9=%%I
for /f %%I in ("2") do set L10=%%I
for /f %%I in ("3") do set L11=%%I
for /f %%I in ("4") do set L12=%%I
for /f %%I in ("5") do set L13=%%I
for /f %%I in ("6") do set L14=%%I
for /f %%I in ("7") do set L15=%%I
for /f %%I in ("8") do set L16=%%I
for /f %%I in ("9") do set L17=%%I
for /f %%I in (":") do set L18=%%I
set L19=;
for /f %%I in ("<") do set L20=%%I
for /f %%I in ("equals") do set L21=%%I
for /f %%I in (">") do set L22=%%I
for /f %%I in ("?") do set L23=%%I
for /f %%I in ("@") do set L24=%%I
for /f %%I in ("a") do set L25=%%I
for /f %%I in ("b") do set L26=%%I
for /f %%I in ("c") do set L27=%%I
for /f %%I in ("d") do set L28=%%I
for /f %%I in ("e") do set L29=%%I
for /f %%I in ("f") do set L30=%%I
for /f %%I in ("g") do set L31=%%I
for /f %%I in ("h") do set L32=%%I
for /f %%I in ("i") do set L33=%%I
for /f %%I in ("j") do set L34=%%I
for /f %%I in ("k") do set L35=%%I
for /f %%I in ("l") do set L36=%%I
for /f %%I in ("m") do set L37=%%I
for /f %%I in ("n") do set L38=%%I
for /f %%I in ("o") do set L39=%%I
for /f %%I in ("p") do set L40=%%I
for /f %%I in ("q") do set L41=%%I
for /f %%I in ("r") do set L42=%%I
for /f %%I in ("s") do set L43=%%I
for /f %%I in ("t") do set L44=%%I
for /f %%I in ("u") do set L45=%%I
for /f %%I in ("v") do set L46=%%I
for /f %%I in ("w") do set L47=%%I
for /f %%I in ("x") do set L48=%%I
for /f %%I in ("y") do set L49=%%I
for /f %%I in ("z") do set L50=%%I
for /f %%I in ("[") do set L51=%%I
for /f %%I in ("\") do set L52=%%I
for /f %%I in ("]") do set L53=%%I
for /f %%I in ("_") do set L54=%%I
for /f %%I in ("`") do set L55=%%I
for /f %%I in ("POINTUP") do set L56=%%I
for /f %%I in ("b") do set L57=%%I
for /f %%I in ("c") do set L58=%%I
for /f %%I in ("d") do set L59=%%I
for /f %%I in ("e") do set L60=%%I
for /f %%I in ("f") do set L61=%%I
for /f %%I in ("g") do set L62=%%I
for /f %%I in ("h") do set L63=%%I
for /f %%I in ("i") do set L64=%%I
for /f %%I in ("j") do set L65=%%I
for /f %%I in ("k") do set L66=%%I
for /f %%I in ("l") do set L67=%%I
for /f %%I in ("m") do set L68=%%I
for /f %%I in ("n") do set L69=%%I
for /f %%I in ("o") do set L70=%%I
for /f %%I in ("p") do set L71=%%I
for /f %%I in ("q") do set L72=%%I
for /f %%I in ("r") do set L73=%%I
for /f %%I in ("s") do set L74=%%I
for /f %%I in ("t") do set L75=%%I
for /f %%I in ("u") do set L76=%%I
for /f %%I in ("v") do set L77=%%I
for /f %%I in ("w") do set L78=%%I
for /f %%I in ("x") do set L79=%%I
for /f %%I in ("y") do set L80=%%I
for /f %%I in ("z") do set L81=%%I
for /f %%I in ("{") do set L82=%%I
for /f %%I in ("|") do set L83=%%I
for /f %%I in ("}") do set L84=%%I
for /f %%I in ("~") do set L85=%%I
for /f %%I in ("") do set L86=%%I
for /f %%I in ("€") do set L87=%%I
for /f %%I in ("") do set L88=%%I
for /f %%I in (",") do set L89=%%I
for /f %%I in ("ƒ") do set L90=%%I
for /f %%I in (",,") do set L91=%%I
for /f %%I in ("...") do set L92=%%I
for /f %%I in ("†") do set L93=%%I
for /f %%I in ("‡") do set L94=%%I
for /f %%I in ("ˆ") do set L95=%%I
for /f %%I in ("‰") do set L96=%%I
for /f %%I in ("Š") do set L97=%%I
for /f %%I in ("‹") do set L98=%%I
for /f %%I in ("Œ") do set L99=%%I
for /f %%I in ("") do set L100=%%I
for /f %%I in ("Ž") do set L101=%%I
for /f %%I in ("") do set L102=%%I
for /f %%I in ("") do set L103=%%I
for /f %%I in ("'") do set L104=%%I
for /f %%I in ("'") do set L105=%%I
for /f %%I in (""") do set L106=%%I
for /f %%I in (""") do set L107=%%I
for /f %%I in ("•") do set L108=%%I
for /f %%I in ("–") do set L109=%%I
for /f %%I in ("—") do set L110=%%I
for /f %%I in ("˜") do set L111=%%I
for /f %%I in ("™") do set L112=%%I
for /f %%I in ("š") do set L113=%%I
for /f %%I in ("›") do set L114=%%I
for /f %%I in ("œ") do set L115=%%I
for /f %%I in ("") do set L116=%%I
for /f %%I in ("ž") do set L117=%%I
for /f %%I in ("Ÿ") do set L118=%%I
for /f %%I in ("¡") do set L119=%%I
for /f %%I in ("¢") do set L120=%%I
for /f %%I in ("£") do set L121=%%I
for /f %%I in ("¤") do set L122=%%I
for /f %%I in ("¥") do set L123=%%I
for /f %%I in ("¦") do set L124=%%I
for /f %%I in ("§") do set L125=%%I
for /f %%I in ("¨") do set L126=%%I
for /f %%I in ("©") do set L127=%%I
for /f %%I in ("ª") do set L128=%%I
for /f %%I in ("«") do set L129=%%I
for /f %%I in ("¬") do set L130=%%I
for /f %%I in ("­") do set L131=%%I
for /f %%I in ("®") do set L132=%%I
for /f %%I in ("¯") do set L133=%%I
for /f %%I in ("°") do set L134=%%I
for /f %%I in ("±") do set L135=%%I
for /f %%I in ("²") do set L136=%%I
for /f %%I in ("³") do set L137=%%I
for /f %%I in ("´") do set L138=%%I
for /f %%I in ("µ") do set L139=%%I
for /f %%I in ("¶") do set L140=%%I
for /f %%I in ("·") do set L141=%%I
for /f %%I in ("¸") do set L142=%%I
for /f %%I in ("¹") do set L143=%%I
for /f %%I in ("º") do set L144=%%I
for /f %%I in ("»") do set L145=%%I
for /f %%I in ("¼") do set L146=%%I
for /f %%I in ("½") do set L147=%%I
for /f %%I in ("¾") do set L148=%%I
for /f %%I in ("¿") do set L149=%%I
for /f %%I in ("À") do set L150=%%I
for /f %%I in ("Á") do set L151=%%I
for /f %%I in ("") do set L152=%%I
for /f %%I in ("Ã") do set L153=%%I
for /f %%I in ("Ä") do set L154=%%I
for /f %%I in ("Å") do set L155=%%I
for /f %%I in ("Æ") do set L156=%%I
for /f %%I in ("Ç") do set L157=%%I
for /f %%I in ("È") do set L158=%%I
for /f %%I in ("É") do set L159=%%I
for /f %%I in ("Ê") do set L160=%%I
for /f %%I in ("Ë") do set L161=%%I
for /f %%I in ("Ì") do set L162=%%I
for /f %%I in ("Í") do set L163=%%I
for /f %%I in ("Î") do set L164=%%I
for /f %%I in ("Ï") do set L165=%%I
for /f %%I in ("Ð") do set L166=%%I
for /f %%I in ("Ñ") do set L167=%%I
for /f %%I in ("Ò") do set L168=%%I
for /f %%I in ("Ó") do set L169=%%I
for /f %%I in ("Ô") do set L170=%%I
for /f %%I in ("Õ") do set L171=%%I
for /f %%I in ("Ö") do set L172=%%I
for /f %%I in ("×") do set L173=%%I
for /f %%I in ("Ø") do set L174=%%I
for /f %%I in ("Ù") do set L175=%%I
for /f %%I in ("Ú") do set L176=%%I
for /f %%I in ("Û") do set L177=%%I
for /f %%I in ("Ü") do set L178=%%I
for /f %%I in ("Ý") do set L179=%%I
for /f %%I in ("Þ") do set L180=%%I
for /f %%I in ("ß") do set L181=%%I
for /f %%I in ("à") do set L182=%%I
for /f %%I in ("á") do set L183=%%I
for /f %%I in ("") do set L184=%%I
for /f %%I in ("ã") do set L185=%%I
for /f %%I in ("ä") do set L186=%%I
for /f %%I in ("å") do set L187=%%I
for /f %%I in ("æ") do set L188=%%I
for /f %%I in ("ç") do set L189=%%I
for /f %%I in ("è") do set L190=%%I
for /f %%I in ("é") do set L191=%%I
for /f %%I in ("ê") do set L192=%%I
for /f %%I in ("ë") do set L193=%%I
for /f %%I in ("ì") do set L194=%%I
for /f %%I in ("í") do set L195=%%I
for /f %%I in ("î") do set L196=%%I
for /f %%I in ("ï") do set L197=%%I
for /f %%I in ("ð") do set L198=%%I
for /f %%I in ("ñ") do set L199=%%I
for /f %%I in ("ò") do set L200=%%I
for /f %%I in ("ó") do set L201=%%I
for /f %%I in ("ô") do set L202=%%I
for /f %%I in ("õ") do set L203=%%I
for /f %%I in ("ö") do set L204=%%I
for /f %%I in ("÷") do set L205=%%I
for /f %%I in ("ø") do set L206=%%I
for /f %%I in ("ù") do set L207=%%I
for /f %%I in ("ú") do set L208=%%I
for /f %%I in ("û") do set L209=%%I
for /f %%I in ("ü") do set L210=%%I
for /f %%I in ("ý") do set L211=%%I
for /f %%I in ("þ") do set L212=%%I
for /f %%I in ("ÿ") do set L213=%%I
for /f %%I in ("'") do set L214=%%I
for /f %%I in ("And") do set L215=%%I
for /f %%I in ("%%") do set L216=%%I
for /f %%I in ("$") do set L217=%%I
for /f %%I in ("#") do set L218=%%I
set L219=Quote
for /f %%I in ("!") do set L220=%%I
for /f %%I in ("§") do set L221=%%I
for /f %%I in ("¶") do set L222=%%I
for /f %%I in ("¤") do set L223=%%I
for /f %%I in ("£") do set L224=%%I
for /f %%I in ("Ø") do set L225=%%I
for /f %%I in ("×") do set L226=%%I
for /f %%I in ("ƒ") do set L227=%%I
for /f %%I in ("á") do set L228=%%I
for /f %%I in ("í") do set L229=%%I
for /f %%I in ("ó") do set L230=%%I
for /f %%I in ("ú") do set L231=%%I
for /f %%I in ("ñ") do set L232=%%I
for /f %%I in ("Ñ") do set L233=%%I
for /f %%I in ("ª") do set L234=%%I
for /f %%I in ("º") do set L235=%%I
for /f %%I in ("¿") do set L236=%%I
for /f %%I in ("®") do set L237=%%I
for /f %%I in ("¬") do set L238=%%I
for /f %%I in ("½") do set L239=%%I
for /f %%I in ("¼") do set L240=%%I
for /f %%I in ("¡") do set L241=%%I
for /f %%I in ("«") do set L242=%%I
for /f %%I in ("»") do set L243=%%I
for /f %%I in ("Á") do set L244=%%I
for /f %%I in ("") do set L245=%%I
for /f %%I in ("À") do set L246=%%I
for /f %%I in ("©") do set L247=%%I
for /f %%I in ("¢") do set L248=%%I
for /f %%I in ("¥") do set L249=%%I
for /f %%I in ("ã") do set L250=%%I
for /f %%I in ("Ã") do set L251=%%I
for /f %%I in ("¤") do set L252=%%I
for /f %%I in ("ð") do set L253=%%I
for /f %%I in ("Ð") do set L254=%%I
for /f %%I in ("Ê") do set L255=%%I
for /f %%I in ("Ë") do set L256=%%I
set L257=Space

set J0=qw
set J1=we
set J2=er
set J3=rt
set J4=ty
set J5=yu
set J6=io
set J7=op
set J8=as
set J9=sd
set J10=df
set J11=fg
set J12=gh
set J13=hj
set J14=jk
set J15=kl
set J16=zx
set J17=xc
set J18=cv
set J19=vb
set J20=bn
set J21=nm
set J22=qa
set J23=ws
set J24=ed
set J25=rf
set J26=tg
set J27=yh
set J28=uj
set J29=ik
set J30=ol
set J31=az
set J32=sx
set J33=dc
set J34=fv
set J35=gb
set J36=hn
set J37=jm
set J38=wa
set J39=es
set J40=rd
set J41=tf
set J42=yg
set J43=uh
set J44=ij
set J45=ok
set J46=pl
set J47=sz
set J48=dx
set J49=fc
set J50=gv
set J51=hb
set J52=jn
set J53=km
set J54=po
set J55=oi
set J56=iu
set J57=uy
set J58=yt
set J59=tr
set J60=re
set J61=ew
set J62=wq
set J63=lk
set J64=kj
set J65=jh
set J66=hg
set J67=gf
set J68=fd
set J69=ds
set J70=sa
set J71=mn
set J72=nb
set J73=bv
set J74=vc
set J75=cx
set J76=xz
set J77=aq
set J78=sw
set J79=de
set J80=fr
set J81=gt
set J82=hy
set J83=ju
set J84=ki
set J85=lo
set J86=za
set J87=xs
set J88=cd
set J89=vf
set J90=bg
set J91=nh
set J92=mj
set J93=aw
set J94=se
set J95=dr
set J96=ft
set J97=gy
set J98=hu

set J99=ji
set J100=ko
set J101=lp
set J102=zs
set J103=xd
set J104=cf
set J105=vg
set J106=bh
set J107=nj
set J108=mk
set J109=qz
set J110=wx
set J111=ec
set J112=rv
set J113=tb
set J114=yn
set J115=um
set J116=om
set J117=in
set J118=ub
set J119=yv
set J120=tc
set J121=rx
set J122=ez
set J123=zq
set J124=xw
set J125=ce
set J126=vr
set J127=bt
set J128=ny
set J129=mu
set J130=mo
set J131=ni
set J132=bu
set J133=vy
set J134=ct
set J135=xr
set J136=ze
set J137=qe
set J138=wr
set J139=et
set J140=ry
set J141=tu
set J142=yi
set J143=uo
set J144=ip
set J145=ad
set J146=sf
set J147=dg
set J148=fh
set J149=gj
set J150=hk
set J151=jl
set J152=zc
set J153=xv
set J154=cb
set J155=vn
set J156=bm
set J157=eq
set J158=rw
set J159=te
set J160=yr
set J161=ut
set J162=iy
set J163=ou
set J164=pi
set J165=da
set J166=fs
set J167=gd
set J168=hf
set J169=jg
set J170=kh
set J171=lj
set J172=cz
set J173=vx
set J174=bc
set J175=nv
set J176=mb
set J177=rq
set J178=tw
set J179=ye
set J180=ur
set J181=it
set J182=oy
set J183=pu
set J184=fa
set J185=gs
set J186=hd
set J187=jf
set J188=kg
set J189=lh
set J190=vz
set J191=bx
set J192=nc
set J193=mv
set J194=qr
set J195=wt
set J196=ey
set J197=ru
set J198=ti
set J199=yo
set J200=up
set J201=af
set J202=sg
set J203=dh
set J204=fj
set J205=gk
set J206=hl
set J207=zv
set J208=xb
set J209=cn
set J210=vm
set J211=qt
set J212=wy
set J213=eu
set J214=ri
set J215=to
set J216=yp
set J217=ag
set J218=sh
set J219=dj
set J220=fk
set J221=gl
set J222=zb
set J223=xn
set J224=cm
set J225=tq
set J226=yw
set J227=ue
set J228=ir
set J229=ot
set J230=py
set J231=ga
set J232=hs
set J233=jd
set J234=kf
set J235=lg
set J236=bz
set J237=nx
set J238=mc
set J239=qy
set J240=wu
set J241=ei
set J242=ro
set J243=tp
set J244=ah
set J245=sj
set J246=dk
set J247=fl
set J248=zn
set J249=xm
set J250=mx
set J251=nz
set J252=lf
set J253=kd
set J254=js
set J255=ha
set J256=pt
set j257=zp

set countera=-1
set counterb=-1
set counterc=-1


:pcharloop
set /a countera= %countera% + 1
set /a counterc= %counterc% + 1
set templ=!pchar%countera%!
set pchar%countera%=
if not defined templ goto allcharloop
if defined %templ% goto pcharloop
for /f %%I in ("%templ%") do set %%I=!J%counterc%!
for /f %%I in ("!J%counterc%!") do set %%I=%templ%
if not defined %templ% goto backupset
goto pcharloop


:allcharloop
set /a counterb= %counterb% + 1
set /a counterc= %counterc% + 1
if /i %counterB% geq 258 exit /b
if /i %counterB% equ 20 goto backupset

set templ=!L%counterb%!
set tempj=!J%counterc%!

for /f %%I in ("%templ%") do if defined %%I set /a counterc=%counterc% - 1& goto allcharloop
for /f "delims=" %%I in ("%templ%") do (
set %%I=%tempj%
set %tempj%=%%I
)
goto allcharloop

:backupset
set !templ!=!J%counterc%!
set !J%counterc%!=!templ!
goto allcharloop






:startencode

set layersdone=1
set counterx=0
set counterI=0

:MEnumerator
set Mchar%counterx%=!message:~%counterX%,1!
if "!Mchar%counterx%!"=="" goto encodemessage
set /a counterx= !counterx! + 1
goto Menumerator

:encodemessage
if /i %counterI% equ %counterX% goto FirstEncodeDone
set temp=!Mchar%counterI%!
set Mchar%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!!%temp%!
set /a counterI= %counterI% + 1
goto encodemessage

:FirstEncodeDone
if /i %layersdone% equ %encodinglayers% (
set layersdone=
exit /b
)
set counterx=0
set counterI=0
set second_encode=1
set message=!encodedmessage!
set encodedmessage=
set /a layersdone= %layersdone% + 1
goto MEnumerator




:startdecode
set layersdone=1
set counterx=0
set countery=0
set counterI=0


:DEnumerator
set Dchar%counterY%=!encodedmessage:~%counterX%,2!
if "!Dchar%counterY%!"=="" set /a counterx=(counterx/2)& goto Decodemessage
set /a counterx= !counterx! + 2
set /a counterY= !counterY! + 1
goto Denumerator

:Decodemessage
if /i %counterI% equ %counterX% goto Dmessagefinished
set temp=!Dchar%counterI%!
set Dchar%counterI%=
if /i "!%temp%!"=="Quote" set %temp%="
if /i "!%temp%!"=="Space" set %temp%=
if /i "!%temp%!"=="Equals" set %temp%==
if /i "!%temp%!"=="POINTUP" for /f %%I in ("^") do set %temp%=%%I
SET decodedmessage=!decodedmessage!!%temp%!
set /a counterI= %counterI% + 1
goto Decodemessage


:Dmessagefinished
if /i NOT %layersdone% equ %encodinglayers% (
set /a layersdone= !layersdone! + 1
set encodedmessage=!decodedmessage!
set counterI=0
set countery=0
set counterx=0
set decodedmessage=
goto DEnumerator
)
::for /f %%I in ("&") do set and=%%I
::for /f %%I in ("%decodedmessage:&=!and!%") set decodedmessage=%%I
::echo !decodedmessage!&pause
set layersdone=
exit /b


::##########################################################################################




::##########################################################################################




::##########################################################################################



:SecondWindow
title !ConversationPath!
set lineoffset=2
for /f "delims=" %%I in ("%2") do set ConversationPath=%%I
if /i "%3" equ 1 do set encryptedconvo=1



:DoubleWindow_StartSpeaking

set gotnewmsg=
set newmessagecount=0
set testmessagecount=0



if not exist !conversationpath! echo Conversation Deleted...& pause& exit /b

for /f "skip=%lineoffset% delims=" %%I in (!conversationpath!) do (
set /a newmessagecount= !newmessagecount! + 1
set newmessage!newmessagecount!=%%I
call :foundmessages
)

if messagefailed==1 (
set messagefailed=
goto DoubleWindow_NoNewMessages
)
goto DoubleWindow_MoreNewMessages



:DoubleWindow_MoreNewMessages
if /i %testmessagecount% equ %newmessagecount% goto DoubleWindow_NoNewMessages
set /a testmessagecount= !testmessagecount! + 1

echo "!newmessage%testmessagecount%!" | find /i "~~~User " >nul

if /i !errorlevel! equ 0 (
echo !newmessage%testmessagecount%!
set /a lineoffset= !lineoffset! + 1
goto DoubleWindow_MoreNewMessages
)

for /f "tokens=1,* delims=~" %%I in ("!newmessage%testmessagecount%!") do set nameofspeaker=%%I& set sortedmessage=%%J
set newmessage%testmessagecount%=
echo !nameofspeaker! says:
echo !sortedmessage:~1!
echo.
set /a lineoffset=!lineoffset! + 2
if /i not %testmessagecount% equ %newmessagecount% goto DoubleWindow_MoreNewMessages

:DoubleWindow_NoNewMessages

if not defined usermessage goto DoubleWindow_StartSpeaking


























:FirstWindow
title Enter your messages here. !Conversationpath!
echo Enter your message.
echo Enter /Exit to quit.
for /L %%I in (1,1,21) do echo.


:DoubleWindow_EnterMessage
set usermessage=
set /p usermessage=
if not defined usermessage goto DoubleWindow_EnterMessage

echo.

if not exist !conversationpath! cls& echo Conversation Deleted...& pause& goto choice
if /i "%usermessage%"=="/exit" goto DoubleWindow_Exit


set message=%Fileusername% [%time:~0,-3%]~ !usermessage!
if defined encryptedconvo (
set encodedmessage=
call :startencode
set message=!encodedmessage!
set encodedmessage=
)
>>!conversationpath! echo.
>>!conversationpath! echo %message%

goto DoubleWindow_Entermessage

:Doublewindow_exit
Echo Choose Option:
echo 1. Exit and delete conversation
echo 2. Exit and save conversation
echo 3. Resume
set choice=
set /p choice=
if not defined choice echo.& goto Doublewindow_exit
if /i "%choice%"==" " echo.& goto Doublewindow_exit
set choice=%choice:~0,1%
if /i not %choice% geq 1 echo.& goto Doublewindow_exit
if /i not %choice% leq 3 echo.& goto Doublewindow_exit

if %choice%==1 del "!conversationpath!"& cls& goto Choice
if %choice%==2 copy "!conversationpath!" !Savepath!\%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.
No hay ser humano inteligente, que aquel que no lee...

xBart

Perdon, no sabia cual eran esas etiquetas pero, ya las vi, gracias
Pero lo de mi codigo, solo es una duda, si no se puede no ay problema.

Gracias
No hay ser humano inteligente, que aquel que no lee...

SuperDraco

No he vuelto, solo estoy de paso.