Search found 13 matches

by PiotrMP006
17 May 2021 00:49
Forum: DOS Batch Forum
Topic: How to add files larger than 100 kb to the 7z archive?
Replies: 1
Views: 604

How to add files larger than 100 kb to the 7z archive?

Hi

How to add files larger than 100 kb to the 7z archive?
by PiotrMP006
05 Apr 2021 02:27
Forum: DOS Batch Forum
Topic: How do I convert batch script arguments to pattern?
Replies: 6
Views: 1897

Re: How do I convert batch script arguments to pattern?

Hi

It doesn't work if names don't always have quotation marks.

Names without spaces do not have quotation marks (Total Commander %S).



ex

%* Test1.7z "Test 2.zip" Test2.rar

%1 Test1.7z
%2 "Test 2.zip"
%3 Test3.rar

Please help me
by PiotrMP006
31 Mar 2021 08:37
Forum: DOS Batch Forum
Topic: How do I convert batch script arguments to pattern?
Replies: 6
Views: 1897

Re: How do I convert batch script arguments to pattern?

For space don't work

%* =" test 1.7z" "test 2.7z" "test 3.7z"
by PiotrMP006
31 Mar 2021 07:48
Forum: DOS Batch Forum
Topic: How do I convert batch script arguments to pattern?
Replies: 6
Views: 1897

How do I convert batch script arguments to pattern?

Hi

How do I convert batch script arguments to pattern?

-ai!test1.7z -ai!test2.7z -ai!test3.7z

%1 = test1.7z
%2 = test2.7z
%3 = test3.7z

%* = test1.7z test2.7z test3.7z

Please help
by PiotrMP006
28 Sep 2020 03:05
Forum: DOS Batch Forum
Topic: How to remove Quotes from a variable with "ampersand" (&) ?
Replies: 1
Views: 1537

How to remove Quotes from a variable with "ampersand" (&) ?

How to remove Quotes from a variable with "ampersand" (&) ?

ex

setlocal disabledelayedexpansion

set dir="D:\Test ! & Test\"

set dir=%dir:"=%

after

echo %dir%

D:\Test ! Test\

Sign & is missing !!!!

Please help
by PiotrMP006
16 Aug 2020 09:19
Forum: DOS Batch Forum
Topic: How do I get an extension if the filename has two dots?
Replies: 1
Views: 1370

How do I get an extension if the filename has two dots?

How do I get an extension if the filename has two dots?

ex.

Test.aaa.txt

%~r1 -> aaa.txt

Please help me
by PiotrMP006
23 Dec 2019 06:34
Forum: DOS Batch Forum
Topic: For /f loop findstr problem The batch script finds nothing !!!
Replies: 2
Views: 2084

For /f loop findstr problem The batch script finds nothing !!!

"C:\Program Files\7-Zip\7z.exe" h -scrcsha256 "Test.7z" output: SHA256 Size Name ---------------------------------------------------------------- ------------- ------------ 1D29A48C53E20F5E854FA67A81FFAD7366DF42E507D319CC41FF21E7DE4A4DBC 106 Test.7z --------------------------------------------------...
by PiotrMP006
23 Dec 2019 01:38
Forum: DOS Batch Forum
Topic: How do I find an error in the for loop if there is no directory found?
Replies: 1
Views: 1686

How do I find an error in the for loop if there is no directory found?

How do I find an error in the for loop if there is no directory found?

ex.

Code: Select all

for /f "tokens=*" %%a in ('dir "%cd%" /a:d /b 2^> nul') do (
echo %%a
)
%errorlevel% always is 0

Please help me
by PiotrMP006
09 Dec 2019 06:12
Forum: DOS Batch Forum
Topic: If Else bracket error Help
Replies: 2
Views: 1977

If Else bracket error Help

Why this code does not work?

Code: Select all

if exist "D:\Test1" if exist "D:\Test2" (
echo OK
) else (
echo Error
)
pause
This code works but I don't know why this extra brace?

Code: Select all

if exist "D:\Test1" if exist "D:\Test2" (
echo OK
)
) else (
echo Error
)
pause
Please Help
by PiotrMP006
02 Apr 2019 02:13
Forum: DOS Batch Forum
Topic: How to check console window width columns in bath script?
Replies: 1
Views: 1571

How to check console window width columns in bath script?

Hi

How to check console window width columns in bath script?
by PiotrMP006
19 Jun 2018 06:30
Forum: DOS Batch Forum
Topic: What's wrong" For loop and pipe | "" problem
Replies: 3
Views: 2247

What's wrong" For loop and pipe | "" problem

Code: Select all

for /f %%a in ('gpg --list-keys --with-colons ^| findstr "Peter Pan"') do set test=%%a
With findstr "Peter Pan" don't work

With findstr Peter work

Why don't work with ""

Help
by PiotrMP006
04 Oct 2017 02:18
Forum: DOS Batch Forum
Topic: How to correctly remove all files from a directory in Windows7?
Replies: 1
Views: 1280

How to correctly remove all files from a directory in Windows7?

How to correctly remove all files from a directory in Windows7?

Without *

Code: Select all

del C:\Test

With *

Code: Select all

del C:\Test\*
by PiotrMP006
08 Sep 2017 06:13
Forum: DOS Batch Forum
Topic: How to sort numeric variables ascending in DOS Batch?
Replies: 2
Views: 2613

How to sort numeric variables ascending in DOS Batch?

How to sort numeric variables ascending in DOS Batch?

ex.

set number1=4
set number2=1
set number3=5
set number4=2
set number5=3

How to create a variable with sorted numbers

Result 1 2 3 4 5