Search found 4506 matches
- 19 Oct 2022 17:10
- Forum: DOS Batch Forum
- Topic: How to parse and extract data from string with jrepl
- Replies: 6
- Views: 2850
Re: How to parse and extract data from string with jrepl
Assuming your string is read from a file (test.txt in the example below), JREPL could be used like that: @echo off for /f "delims=" %%i in ( 'jrepl.bat ".*- POE: ([^-\s]+).*- UserID: ([^-\s]+).*" "set \x22POE=$1\x22\nset \x22UserID=$2\x22" /XSEQ /A /F "test.txt"' ) do %%i echo %POE% echo %UserID% pa...
- 19 Oct 2022 13:58
- Forum: DOS Batch Forum
- Topic: I can't see the var from an echo
- Replies: 14
- Views: 5490
Re: I can't see the var from an echo
I don't know. If you're sure the network resource is properly shared and existing, something like this might help:
https://learn.microsoft.com/en-us/troub ... -resources
https://learn.microsoft.com/en-us/troub ... -resources
- 19 Oct 2022 04:28
- Forum: DOS Batch Forum
- Topic: Backup Batch File
- Replies: 15
- Views: 6054
Re: Backup Batch File
Would it be difficult to just have it replace whatever files are new within the backup and also replace the folder name to have the current date to the day that I run this batch file? Not too difficult. At least not if you do it the other way around (first rename using MOVE because it supports wild...
- 19 Oct 2022 04:20
- Forum: DOS Batch Forum
- Topic: Complete control of cmd windows
- Replies: 88
- Views: 66731
Re: Complete control of cmd windows
Oh, I'm pretty sure you've been facing this bug. Look at post #5. Finally you worked around this issue by calling the macro before CHCP 65001. At least that's been my understanding. Hmm...
- 18 Oct 2022 14:24
- Forum: DOS Batch Forum
- Topic: Backup Batch File
- Replies: 15
- Views: 6054
Re: Backup Batch File
Give this a go: @echo Off for /f %%i in ('wmic OS GET LocalDateTime /value') do for /f "tokens=2 delims==." %%j in ("%%i") do set "dt=%%j" echo %dt:~4,2%-%dt:~6,2%-%dt:~0,4% pause However, think about how your folder names are ordered as soon as folders from 2023 are getting merged in next year. May...
- 18 Oct 2022 11:28
- Forum: DOS Batch Forum
- Topic: Complete control of cmd windows
- Replies: 88
- Views: 66731
Re: Complete control of cmd windows
Since I gained some more experiences in this thread I'm about to refactor a few of the PS macros. There's one thing I'm still wondering though: At the beginning of this thread you told that you've been facing a bug of PowerShell v.5.1 when it gets executed in a UTF-8 environment. From what I've read...
- 17 Oct 2022 15:10
- Forum: DOS Batch Forum
- Topic: I can't see the var from an echo
- Replies: 14
- Views: 5490
Re: I can't see the var from an echo
::*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ Set "inffile=%wkdir%VNCsetup.inf" echo !inffile! ;I see this in the cmd window echo %wkdir%%FileName% ;I see this in the cmd window just fine ::*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~...
- 17 Oct 2022 14:47
- Forum: DOS Batch Forum
- Topic: I can't see the var from an echo
- Replies: 14
- Views: 5490
Re: I can't see the var from an echo
Now that I've taken a closer look at your screenshot it turns out that you have a lot of spaces after the .inf extension.
One of the reasons why you should prefer
to
One of the reasons why you should prefer
Code: Select all
set "var=value"
Code: Select all
set var=value
- 17 Oct 2022 14:36
- Forum: DOS Batch Forum
- Topic: I can't see the var from an echo
- Replies: 14
- Views: 5490
Re: I can't see the var from an echo
Remove the @echo off. Alternatively update off to on.I'd like to see all cmds echo'ed to the window. Is there a way I can see that?
Furthermore you can turn it off and on again at any position in your script.
- 17 Oct 2022 13:57
- Forum: DOS Batch Forum
- Topic: I can't see the var from an echo
- Replies: 14
- Views: 5490
Re: I can't see the var from an echo
I'm not familiar with UltraVNC. And in particular I'm not familiar with its command line syntax. A quick research in the internet suggests to enclose the path in quotes, like so: /loadinf="!inffile!" Also, in the same source I found that your /Very silent should rather be /verysilent at least withou...
- 17 Oct 2022 00:33
- Forum: DOS Batch Forum
- Topic: I can't see the var from an echo
- Replies: 14
- Views: 5490
Re: I can't see the var from an echo
As always - if you update a variable value in a parenthesized block, and you want to access this value in the same block, you will need to enable delayed expansion and enclose your variables into exclamation points rather than percent signs. Proper line indentation helps to recognize whether you're ...
- 16 Oct 2022 14:52
- Forum: DOS Batch Forum
- Topic: How to add a CRLF
- Replies: 2
- Views: 1761
Re: How to add a CRLF
Try something about like that. @echo off (set lf=^ %= creates a line feed, do not alter =% ) setlocal EnableDelayedExpansion set "file=" if not exist "foo.exe" set "file=!file!!lf! ? foo.exe" if not exist "bar.txt" set "file=!file!!lf! ? bar.txt" if defined file ( echo ? The files ...!file! echo ? ....
- 15 Oct 2022 06:07
- Forum: DOS Batch Forum
- Topic: Complete control of cmd windows
- Replies: 88
- Views: 66731
Re: Complete control of cmd windows
FORFILES might still be useful if you want to create more C0 characters used in VT processing. In this case take a path which is supposed to not containing special characters. Such like /p "%__APPDIR__%." /m "cmd.exe".
viewtopic.php?f=3&t=10348&p=65991#p65991
viewtopic.php?f=3&t=10348&p=65991#p65991
- 14 Oct 2022 06:29
- Forum: DOS Batch Forum
- Topic: Complete control of cmd windows
- Replies: 88
- Views: 66731
Re: Complete control of cmd windows
I did not understand, how should I do? Recently you began using FORFILES to create the ESC character. Please don't. If you want to figure out why, rename your script to, say, "test %!&)^.bat" and you'll find the ESC not being created anymore :wink: Instead use for /f "delims=" %%E in ( 'echo prompt...
- 13 Oct 2022 15:40
- Forum: DOS Batch Forum
- Topic: Complete control of cmd windows
- Replies: 88
- Views: 66731
Re: Complete control of cmd windows
That's easy. @echo off setlocal EnableDelayedExpansion call :init_fade %fade% 0 1 100 1 %fade% 100 -1 0 1 exit /b :init_fade setlocal DisableDelayedExpansion :: fade the window in or out :: Usage: :: %fade% start end delay :: start percentage of transparency to begin with :: step number of percents ...