Page 1 of 1

just something i made in my free time on win7

Posted: 10 May 2017 10:21
by sklub
just something i made in my free time on win7:
it does not realy do anything...usefull that cmd cant do.

@echo off
color 0a
Title FILER.
set isfile=0
set backer=0
goto :notfindfile
:main
if %findfile%==0 if %checked%==1 if %equals%==1 goto :notfindfile
if %findfile%==0 if %checked%==1 if %equals%==0 goto :notfindfile
if %findfile%==1 if %checked%==1 if %equals%==0 set findfile=0
if %findfile%==1 if %checked%==1 if %equals%==1 goto :findfile
:checkdesktop
set checked=0
set euqals=0
dir /b > %monitor%\checker.txt
for /f %%Y in ( %monitor%\checker.txt ) do (
if %findfilename%==%%Y set equals=1
)
set checked=1
goto :main
:findfile
set string=%findfilename%}
:decostring
set stringa=%string:~0,1%
set string=%string:~1%
if %stringa%==}, goto :klar
if %stringa%==., set stringb=%memory%
if %stringa%==., set memory=
if %stringa%==., set isfile=1
set memory=%memory%%stringa%
goto :decostring
:klar
if %isfile%==1 goto :isfile
if %isfile%==0 cd %cd%\%memory%
set findfile=0
set memory=
set string=%string%0}
goto :decostringc
:isfile
set isfile=0
if %memory%==.ord goto :ord
if %memory%==.bat start %stringb%%memory%
set stringb=
set memory=
goto :decostringc
:ord
set string=
for /f %%Y in ( %stringb%%memory% ) do (
set input=%%Y}
)
set memory=
goto :deput
:notfindfile
set findfilename=default
set monitor=c:\users\%username%\desktop
set memory=
type %monitor%\checker.txt
set /p input=
cls
:deput
set string=%input%}
if %string%==} set string=0}
:decostringc
set checked=0
set equals=0
set findfile=0
set stringa=%string:~0,1%
set string=%string:~1%
if %stringa%==} goto :main
if %stringa%=={ set findfile=1
if %stringa%=={ set findfilename=%memory%
if %stringa%=={ set memory=
if %stringa%=={ goto :main
set memory=%memory%%stringa%
goto :decostringc

Re: just something i made in my free time on win7

Posted: 10 May 2017 20:01
by ShadowThief
So what is this supposed to do besides throw a "The system cannot find the file specified" error?

Re: just something i made in my free time on win7

Posted: 11 May 2017 03:24
by Compo
Notes:
  1. No commentary or explanation for the purpose or use of the script.
  2. Typo on line 14. (euqals)
  3. checker.txt doesn't exist on my Desktop so cannot be typed. (line 57)
  4. There's an input prompt without instruction on line 58.
  5. The labelled sections are pointlessly in the wrong order making the code harder to follow and one of them isn't required. (notfindfile,deput,decostringc,main,checkdesktop,findfile,decostring,klar,isfile,ord)
  6. Repeated lines used when parentheses would minimize code (lines 8,9,10,11,27,28,29,70,71,72 & 73).
  7. There is a desperate need for many double-quotes. (lines 4,5,8,9,10,11,13,14,15,16,17,19,22,24,25,26,27,28,29,30,33,34,35,36,37,40,41,42,43,44,47,48,49,51,54,55,56,57,58,61,62,64,65,66,67,68,69,70,71,72,73& 74)

Additionally please use code tags when posting code.