Search found 15 matches

by WiVi71
04 May 2020 14:33
Forum: DOS Batch Forum
Topic: Using for command starts/ends with double quote.
Replies: 2
Views: 931

Re: Using for command starts/ends with double quote.

The cause and cure was explained in detail somewhere here in this forum, but my google-fu isn't strong enough (at least tonight). Maybe someone has bookmarked that or remembers why that goes wrong. If i remember right my workaround was, to just add an echo command and to not use delayedExpansion in...
by WiVi71
01 May 2020 16:39
Forum: DOS Batch Forum
Topic: Using for command starts/ends with double quote.
Replies: 2
Views: 931

Using for command starts/ends with double quote.

I'm making a code to get some value from website with curl and sed. The website will include code that starts with name and ends with value with double quote. <div style="display:none;"> something="somethig" categoryNo="[numbers]" </div> In this code, I need [numbers]. Here is the code that I made t...
by WiVi71
14 Apr 2020 14:58
Forum: DOS Batch Forum
Topic: Can't parse arguments to variable
Replies: 5
Views: 1441

Re: Can't parse arguments to variable

After a few attempts, I thought there was a limit to comparing strings containing complex double quotes or parentheses using IF command without error. For example, IF "/SetCustomHeaders "User-Agent: Opera/9.60 (Windows NT 6.0; U; en) Presto/2.1.1"" == "" Command... didn't work. So, I tried to write...
by WiVi71
13 Apr 2020 13:45
Forum: DOS Batch Forum
Topic: Can't parse arguments to variable
Replies: 5
Views: 1441

Re: Can't parse arguments to variable

The comparison with your IF line does not work out as you would expect. If you want to know what goes wrong then you have to evaluate the displayed errors. For successful troubleshooting, it has proven useful to switch on the echo and thus to find something in the last displayed lines that leads to...
by WiVi71
12 Apr 2020 11:45
Forum: DOS Batch Forum
Topic: Can't parse arguments to variable
Replies: 5
Views: 1441

Can't parse arguments to variable

I am making a script that parses /SET1 OP1 OP2 /SET2 OP3 to /SET1 "WORD" OP1 OP2 /SET2 "WORD" OP3 The /SET... always starts with /Set and does not include double quotes. and /OP... may or may not contain double quotes and multiple spaces. This is the code I made to parse the arguments into variables...
by WiVi71
07 Apr 2020 19:45
Forum: DOS Batch Forum
Topic: edit lines in FIND comand
Replies: 2
Views: 866

Re: edit lines in FIND comand

Hi programmers, I'm facing the following task: I have the file "c:\folder\a.txt" with the following content: a b a b c So I use the following batch: find "a" < c:\folder\a.txt >> c:\folder\b.txt and I obtain the c:\folder\b.txt with the following content: a a Now, what if I want to add a string aft...
by WiVi71
21 Mar 2020 19:35
Forum: DOS Batch Forum
Topic: Using Double Pipe in IF command
Replies: 5
Views: 1276

Re: Using Double Pipe in IF command

Also, FOR /F %A IN ('"ECHO WOW"') DO (TIMEOUT 1 && ECHO WOW || ECHO OHH) Worked. I don't see any reason for the for-loop of that command, just use pure conditional-chaining ("&&") and conditional-execution operator ("||"): TIMEOUT 1 && ECHO WOW || ECHO OHH I'm also not fully sure how that for-loop ...
by WiVi71
21 Mar 2020 18:41
Forum: DOS Batch Forum
Topic: Win10: Move cursor position to 0,0
Replies: 4
Views: 1164

Re: Win10: Move cursor position to 0,0

Antonio did something like that before using Windows 8.1: https://www.dostips.com/forum/viewtopic.php?f=3&t=6760 Outdated.PNG The codes we used before(timeout 1 > con) moved cursor position to 1,0 So you should have used a script to lift the cursor position up one line to move the cursor to 0,0 @ec...
by WiVi71
21 Mar 2020 17:13
Forum: DOS Batch Forum
Topic: Using Double Pipe in IF command
Replies: 5
Views: 1276

Re: Using Double Pipe in IF command

I don't think, that WiVi71 tries to use the conditional-execution operator "||" as a conditional-OR operator. @WiVi71 In all the examples you gave, you have used the character COMMA (','). That character is a delimiter and must be escaped, so the following might help you: IF . EQU ^, DISM || ECHO P...
by WiVi71
21 Mar 2020 16:28
Forum: DOS Batch Forum
Topic: Win10: Move cursor position to 0,0
Replies: 4
Views: 1164

Win10: Move cursor position to 0,0

I found that " FOR /F %A IN ('"TIMEOUT 1 > CON"') DO REM " command shows a different output than "TIMEOUT 1 > CON" command(In Windows 10). FOR_TIMEOUT.PNG The command moved the cursor position to 4,0 Also, several special characters were displayed on the screen. So, this code moves cursor position t...
by WiVi71
19 Mar 2020 12:40
Forum: DOS Batch Forum
Topic: Using Double Pipe in IF command
Replies: 5
Views: 1276

Using Double Pipe in IF command

I'm trying to use a double pipe or double ampersand in IF command, but it doesn't work as I expected. > IF . EQU , DISM || ECHO POO || is not expected This does not work. > IF . EQU , (DISM || ECHO POO) || is not expected This does not work either. > IF . EQU , DISM ||(ECHO POO) > IF . EQU , ('DISM ...
by WiVi71
28 Jan 2020 01:16
Forum: DOS Batch Forum
Topic: Is there a way to update progress bar in Windows Vista to 10?
Replies: 5
Views: 2336

Re: Is there a way to update progress bar in Windows Vista to 10?

@ECHO OFF IF /I "%1" == "PRINT" SHIFT & GOTO PRINT FOR /F %%A IN ('COPY /Z "%~DPF0" NUL') DO SET "CR=%%A" SET "BITS_URL=https://raw.githubusercontent.com/EIGHTFINITE-Vendor/wget/wget-1.19.2-win64/wget.exe" SET "BITS_PATH=%USERPROFILE%" :Prepare REM * Prepare - Set Window COLOR 07 TITLE BITSADMIN: D...
by WiVi71
28 Jan 2020 01:16
Forum: DOS Batch Forum
Topic: Is there a way to update progress bar in Windows Vista to 10?
Replies: 5
Views: 2336

Re: Is there a way to update progress bar in Windows Vista to 10?

2. What is the difference between bitsadmin and bitsadmin.exe? If you don't provide the extension, cmd.exe will try all the extensions in enviroment variable PATHEXT, and use the first program that matches. Could it be that you named your test script "bitsadmin.bat" ? In that case, this explains wh...
by WiVi71
28 Jan 2020 00:48
Forum: DOS Batch Forum
Topic: Is there a way to update progress bar in Windows Vista to 10?
Replies: 5
Views: 2336

Re: Is there a way to update progress bar in Windows Vista to 10?

You can change the prompt so that the display can be used as output. https://www.dostips.com/forum/viewtopic.php?f=3&t=8051 @ECHO OFF if :%1 == :print shift &goto :print for /f %%a in ('copy /Z "%~dpf0" nul') do set "CR=%%a" :: This is a part of my batch SET "WGET_URL=https://eternallybored.org/mis...
by WiVi71
07 Jan 2020 10:15
Forum: DOS Batch Forum
Topic: Is there a way to update progress bar in Windows Vista to 10?
Replies: 5
Views: 2336

Is there a way to update progress bar in Windows Vista to 10?

I am making a simple code to download Wget with BITSADMIN contains a progress bar. This is a part of my code : @ECHO OFF :: This is a part of my batch SET "WGET_URL=https://eternallybored.org/misc/wget/1.20.3/64/wget.exe" SET "WGET_PATH=%USERPROFILE%" :Prepare REM * Prepare - Set Window COLOR 07 TIT...