Search found 31 matches

by PiotrMP006
21 May 2024 04:32
Forum: DOS Batch Forum
Topic: Why does "(title Test) & pause" change the window title to "Test - pause" and not to "Test"?
Replies: 3
Views: 9303

Why does "(title Test) & pause" change the window title to "Test - pause" and not to "Test"?

Why does "(title Test) & pause" change the window title to "Test - pause" and not to "Test"?

Image

Please help
by PiotrMP006
10 Jan 2024 02:07
Forum: DOS Batch Forum
Topic: How to replace the script name %~n0 with a string of "-" characters of length %~n0?
Replies: 1
Views: 7986

How to replace the script name %~n0 with a string of "-" characters of length %~n0?

Hi

How to replace the script name %~n0 with a string of "-" characters of length %~n0?

Code: Select all

ex. %~n0 = Test.bat

How do I change "Test.bat" to the string "---------" ?

Test.bat
--------
by PiotrMP006
21 Dec 2023 03:30
Forum: DOS Batch Forum
Topic: Why for loop wmic get processid return an extra invalid value?
Replies: 3
Views: 10532

Why for loop wmic get processid return an extra invalid value?

Hi Why for loop wmic get processid return an extra invalid value? for /f "usebackq skip=1 delims=" %%a in (`wmic process where "name='cmd.exe' and commandline like '%%%~n0%%'" get processid 2^>nul`) do echo %%a The first returned value %%a is the real processid The second returned value %%a is a non...
by PiotrMP006
18 Dec 2023 00:23
Forum: DOS Batch Forum
Topic: How can a batch lower the priority ONLY of the cmd that runs it?
Replies: 1
Views: 7720

How can a batch lower the priority ONLY of the cmd that runs it?

Hi

How can a batch lower the priority ONLY of the cmd that runs it?

Why isn't this code working?

Code: Select all

wmic process where "name='cmd.exe' and commandline like '%%scriptname%%'" call setpriority "high"
Please help
by PiotrMP006
15 Dec 2023 08:55
Forum: DOS Batch Forum
Topic: How to make an underscore variable "-----" with the length of the argument variable?
Replies: 5
Views: 14026

How to make an underscore variable "-----" with the length of the argument variable?

How to make an underscore variable "-----" with the length of the argument variable?

ex.

Code: Select all

Script Name
-----------
Please help
by PiotrMP006
26 Jul 2023 07:17
Forum: DOS Batch Forum
Topic: How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?
Replies: 2
Views: 3434

How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?

Hi

How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?

Code: Select all

ERROR: a.7z : Cannot open encrypted archive. Wrong password?
by PiotrMP006
23 Jul 2023 07:54
Forum: DOS Batch Forum
Topic: Does "endlocal" close all instances of "setlocal"?
Replies: 2
Views: 3624

Does "endlocal" close all instances of "setlocal"?

Does "endlocal" close all instances of "setlocal"?

ex

Code: Select all

setlocal enabledelayedexpansion enableextensions
set name1=1

setlocal disabledelayedexpansion enableextensions
set name2=2

setlocal enabledelayedexpansion enableextensions
set name3=3

endlocal
by PiotrMP006
13 Jun 2023 08:50
Forum: DOS Batch Forum
Topic: How to convert argument list to skip first argument?
Replies: 5
Views: 4742

Re: How to convert argument list to skip first argument?

I need a solution with a FOR loop without SHIFT
by PiotrMP006
13 Jun 2023 08:23
Forum: DOS Batch Forum
Topic: How to convert argument list to skip first argument?
Replies: 5
Views: 4742

How to convert argument list to skip first argument?

How to convert argument list to skip first argument?

%* = "C:\7-Zip Test\" "File&Test 1.txt" "File&Test 2.txt" "File&Test 3.txt"

After conversion, this should be the argument list

%filelist% = "File&Test 1.txt" "File&Test 2.txt" "File&Test 3.txt"


Please help
by PiotrMP006
19 Aug 2022 01:44
Forum: DOS Batch Forum
Topic: How do I check the length of a filename in batch script?
Replies: 1
Views: 3185

How do I check the length of a filename in batch script?

Hi

How do I check the length of a filename in batch script?
by PiotrMP006
04 Aug 2022 03:59
Forum: DOS Batch Forum
Topic: How to replace all characters in a variable with another character?
Replies: 4
Views: 5101

Re: How to replace all characters in a variable with another character?

No

I want to replace all characters in a variable with another character.

ex

abcde -> *****
abcde -> -----
abcde -> #####


Please help me
by PiotrMP006
03 Aug 2022 06:38
Forum: DOS Batch Forum
Topic: How to replace all characters in a variable with another character?
Replies: 4
Views: 5101

How to replace all characters in a variable with another character?

Hi

How to replace all characters in a variable with another character?

ex
abcd -> ****
by PiotrMP006
17 Jul 2022 06:24
Forum: DOS Batch Forum
Topic: "call exit" - Exit batch file from call subroutine
Replies: 3
Views: 3908

Re: "call exit" - Exit batch file from call subroutine

Why is the "call exit" command bad?
by PiotrMP006
17 Jul 2022 04:56
Forum: DOS Batch Forum
Topic: "call exit" - Exit batch file from call subroutine
Replies: 3
Views: 3908

"call exit" - Exit batch file from call subroutine

Code: Select all

call exit
Is this the only effective way to exit batch file from call subroutine?