Z
Z
Zhenyok Kot2017-08-24 17:40:19
IT education
Zhenyok Kot, 2017-08-24 17:40:19

How can I delete files less than one kilobyte from different paths?

Hello, in this topic forum.oszone.net/thread-129366.html they helped me with a code that deletes files smaller than 1 kilobyte. Here I am attaching the code. Such a situation, if we add additional paths, the script still moves files from only one path. Please help me to make it possible to add many paths from which to move files

@echo off
setlocal enableextensions enabledelayedexpansion

set sSourceFolder=C:\Users\Mario\Desktop\STASJI\112
set sSourceFolder=C:\Users\Mario\Desktop\STASJI\113
set sDestFolder=C:\Users\Mario\Desktop\STASJI\vsesuda
set /a iSize = 1^<^<10

if exist "%sSourceFolder%\." (
  if exist "%sDestFolder%\." (
    pushd "%sSourceFolder%"
    
    for /f "usebackq delims=" %%i in (
      `2^>nul dir /b /a:-d "*.*"`
    ) do if %%~zi lss %iSize% (
      echo Moving [%sSourceFolder%\%%~i] into folder [%sDestFolder%]...
      move "%%~i" "%sDestFolder%\"
    )
    
    popd
  ) else (
    echo Can't find destination folder [%sDestFolder%].
    exit /b 2
  )
) else (
  echo Can't find source folder [%sSourceFolder%].
  exit /b 2
)

endlocal
exit /b 0

Answer the question

In order to leave comments, you need to log in

6 answer(s)
N
nrgian, 2019-04-30
@Mirroxx

Strictly speaking, any of the common ones:
Python, Java, JavaScript (not to be confused with Java), PHP, Kotlin, Dart, Go, Ruby, C, C++, Pascal, C#, Rust, and even the 1C language.
And in general - it is possible 2-3. It's hard to learn the first one. Then - the study is much easier and faster.
In addition to them highly specialized - SQL, HTML/CSS. Even if you do not work in this area, it is still extremely useful, because it is found on every corner.
It is difficult to learn concepts, paradigms, patterns, principles.
But they pass from language to language. If you understand them with one language, you will easily get used to another language.
Languages ​​learn one or two.
The most common languages ​​are very similar.
PS:
I would suggest that along with a language with dynamic typing like Python, it is imperative to learn a language with static typing.
For example, start with Pascal specially created for teaching.
Or from specially created for a clear understanding - Go.
Or rather well-designed C#, you can also have fun programming games in the Unity environment (including Android) or convenient desktop application programming in Windows.

S
sim3x, 2019-04-30
@sim3x

After English - any
You still have to learn more than three of them and which one to start with - there is no difference
If you want to earn with your language skills - learn something from tiobe top10
If you want to earn in your local labor market - study what like your employers

K
kova1ev, 2019-04-30
@kova1ev

javascript of course, look at least the top subscriptions / questions on the toaster.
and if it’s direct at all with an eye to the future, study python in depth and move into data scientism.

A
AVKor, 2019-04-30
@AVKor

Pascal.
P.S. Programmers (who have no experience in teaching programming) traditionally 99 times out of 100 confuse two different activities: programming and teaching it. In 99 cases out of 100, they simply offer to start with a programming language that they earn money from (while they do not and should not set such a goal in the process of this very training).

R
Ronald McDonald, 2019-04-30
@Zoominger

Fashionable youth go.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question