Search found 1709 matches

by penpen
31 Oct 2019 02:49
Forum: DOS Batch Forum
Topic: If statement compare two files.
Replies: 4
Views: 402

Re: If statement compare two files.

You could use a for/f loop to store the resulting output into a variable if that is what you want (untested): @echo off setlocal enableExtensions disableDelayedExpansion for /f "skip=1 tokens=* delims=" %a in ('comp sample1.txt sample2.txt /m') do ( set "line=%~a" ) Another option were to use the er...
by penpen
24 Oct 2019 14:49
Forum: DOS Batch Forum
Topic: AYUDA! CON GRAFICOS DE CONSOLA | HELP WITH CONSOLE GRAPHICS
Replies: 2
Views: 1041

Re: AYUDA! CON GRAFICOS DE CONSOLA | HELP WITH CONSOLE GRAPHICS

I'm not sure how that is connected to any batch, you could use code tags ( [ code] [ /code]), also you should provide enough code for a standalone working sample that produces the issue you want to solve. What exactly do you mean by "flashes the (...) screen" ? (Do you mean that the background turns...
by penpen
15 Oct 2019 19:08
Forum: DOS Batch Forum
Topic: Batch program to add text to url
Replies: 3
Views: 1364

Re: Batch program to add text to url

The tool clip.exe could be used for that: @echo off setlocal enableExtensions enableDelayedExpansion :: uri encoded input of form: http://name.com:8080/<username>/<password>/30356 set "input=" set /p "input=" :: variables of form :: "%%~a" = "http:" :: "%%~b" = "name.com:8080" :: "%%~c" = "<username...
by penpen
15 Oct 2019 04:25
Forum: DOS Batch Forum
Topic: Batch program to add text to url
Replies: 3
Views: 1364

Re: Batch program to add text to url

This might help you: @echo off setlocal enableExtensions enableDelayedExpansion :: uri encoded input of form: http://name.com:8080/<username>/<password>/30356 set "input=" set /p "input=" :: variables of form :: "%%~a" = "http:" :: "%%~b" = "name.com:8080" :: "%%~c" = "<username>" :: "%%~d" = "<pass...
by penpen
02 Oct 2019 03:09
Forum: DOS Batch Forum
Topic: Enabling the internal debug outputs of cmd.exe
Replies: 17
Views: 8690

Re: Enabling the internal debug outputs of cmd.exe

I was a bit inaccurate, i meant: That feature (probably) stopped working with installation of version 1903, build 18362.387 (on all pc's). (So i couldn't get it back to work by replacing the hardware.) Using win version 1903, build 18362.387 the nested FOR /F loops just print"jeb" to the screen and ...
by penpen
01 Oct 2019 13:20
Forum: DOS Batch Forum
Topic: Enabling the internal debug outputs of cmd.exe
Replies: 17
Views: 8690

Re: Enabling the internal debug outputs of cmd.exe

So that "undocumented feature" indeed stopped working :cry:
Sad - i liked that a lot.


penpen
by penpen
30 Sep 2019 03:19
Forum: DOS Batch Forum
Topic: Enabling the internal debug outputs of cmd.exe
Replies: 17
Views: 8690

Re: Enabling the internal debug outputs of cmd.exe

Yesterday my Windows 10 home updated to win version 1903 (build 18362.387) and i noticed that enabling debug stopped working. My pc was kind of problematic one because it refused to install that a long time claiming the "Intel Rapid Store Technology (Intel RST)" must be updated first, which was odd,...
by penpen
24 Sep 2019 01:52
Forum: DOS Batch Forum
Topic: How to get .ext ftype into variable
Replies: 2
Views: 1483

Re: How to get .ext ftype into variable

You may use a "for/f"-loop (untested):

Code: Select all

@echo off
setlocal enableExtensions disableDelayedExpansion
for /f "tokens=* delims==" %%a in ('assoc .png') do set "%%~a"

echo(.png=%.png%
goto :eof
penpen
by penpen
23 Sep 2019 05:43
Forum: DOS Batch Forum
Topic: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?
Replies: 4
Views: 1659

Re: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?

Just so I understand we're referring to the same thing, did you mean 'do you know for sure that the blacklist is longer '? Sorry, i meant the whitelist... (instead of the blacklist - i leave that error in my above post). That's the thing, I'm unsure how many Unicode characters the program has issue...
by penpen
22 Sep 2019 02:06
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 2228

Re: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appeara

You may encapsulate the initialization and building of the menues in function calls: @echo off cls setlocal enableExtensions enableDelayedExpansion call :initMenu "choice" call :addMenuItem "choice" "ball" "value 1" call :addMenuItem "choice" "sun" "value 2" call :addMenuItem "choice" "land" "value ...
by penpen
22 Sep 2019 01:38
Forum: DOS Batch Forum
Topic: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?
Replies: 4
Views: 1659

Re: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?

I know the reverse is possible: defining characters one wants to be replaced, but that could be a very long list given how many potential Unicode characters there are. Do you know for sure, that the Blacklist is shorter? How many characters are in that list? With which characters does that program ...
by penpen
21 Sep 2019 18:26
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 2228

Re: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appeara

The thing is, this will be used for some simple user settings so I'm not really counting on them to hand-number them each time they want the order changed. I'm not sure what you mean there... . In case you want the order in a simpler format, where you have to change only one index per entry in your...
by penpen
17 Sep 2019 20:01
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 2228

Re: For loop to do something with all variables beginning/prefixed with a string

but most of the times I experimented with it in a for loop as the command ( in (set example-) do ) an error returned 'The system cannot find the file set.'. You missed a pair of ' characters: @echo off setlocal enableExtensions disableDelayedExpansion set example-foo=something set example-bar=else ...
by penpen
16 Sep 2019 19:42
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 33
Views: 7470

Re: Closing parenthesis prevents escape of subsequent special character operator

It was an attempt to address your question about why the parser behaves differently depending on the command token and why it does not behave the same for e.g. REM and FOR. I probably used bad wording myself (maybe because english isn't my native language and i posted pretty late): Sorry, if i conf...
by penpen
15 Sep 2019 07:46
Forum: DOS Batch Forum
Topic: How To Start @echo off Script After @powershell Script in same BATCHFiLE?
Replies: 6
Views: 1398

Re: How To Start @echo off Script After @powershell Script in same BATCHFiLE?

but the script close when it supposed to restart and it should work it does return to the animated text but as soon as I press a key it close.. I can't reproduce that behaviour (sorry - instead it loops all the time until typing "NO" in one of the screens), did you changed something else in your co...