Search found 1058 matches
- 24 Feb 2025 23:53
- Forum: DOS Batch Forum
- Topic: Put Desktop to sleep from Laptop
- Replies: 5
- Views: 3003
Re: Put Desktop to sleep from Laptop
If you are using at least windows 10 you could use ssh. Laptop> ssh desktopuser@[DesktopName or DesktopIP] "Desk_Sleep.bat" But you have to enable the ssh server on the desktop Get started with OpenSSH for Windows . Then you need to create an ssh keypair on your laptop Generate new ssh keys in Windo...
- 14 Feb 2025 06:22
- Forum: DOS Batch Forum
- Topic: ok if i ask a DOSbox-X batch, need to read 2nd string
- Replies: 2
- Views: 2761
Re: ok if i ask a DOSbox-X batch, need to read 2nd string
Hi nnnmmm, i need a batch that returns a var ABC 2nd line is an empty line are there batch commands to get the 2nd string ABC? I suppose not, but you could solve it with a trick. Build one config file which contains only the "ABC". Then you can build the spec file before you start the compiler by ec...
- 26 Dec 2024 04:57
- Forum: DOS Batch Forum
- Topic: is there a way to display the list without the quotation marks when ampersands present?
- Replies: 3
- Views: 7088
Re: is there a way to display the list without the quotation marks when ampersands present?
And I learned a new variant for the trick last month, now it's enough to use %%" instead of %%~". FOR /F "tokens=* delims=X" %%^" in ("X") do ( echo %%" Special characters &..|..^..<..> echo %%" Event a closing bracket ) doesn't harm ) It's possible to create a single FOR meta-variable that's empty....
- 21 Oct 2024 02:34
- Forum: DOS Batch Forum
- Topic: Progress bar
- Replies: 6
- Views: 39220
Re: Progress bar
And now my own try of a progress bar. But with the use of 8 different steps per single character. It shows the progress bar in the window and in the title I'm using the unicode characters from U+2588 to U+258F. ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ How it looks depends on the selected font. My best results are with a uni...
- 17 Oct 2024 02:05
- Forum: DOS Batch Forum
- Topic: How to break from a .cmd?
- Replies: 2
- Views: 19647
Re: How to break from a .cmd?
You can use a small function to exit only the current batch :exit-current-batch for /L %%# in (0 1 40) DO ( (goto) 2> NUL call set "_tmp=%%0" call set "_tmp=%%_tmp:~0,1%%" call set "_tmp=%%_tmp::=%%" if defined _tmp ( REM Current Batch entry found exit /b ) ) exit /b Just use CALL :exit-current-batc...
- 16 Oct 2024 10:06
- Forum: DOS Batch Forum
- Topic: help with multilinea macro in not delayed
- Replies: 4
- Views: 40427
Re: help with multilinea macro in not delayed
Is it possible to bypass the endlocal barrier/tunnel inside a call of variables that have LF or in any case the code to create multiline macros? Yes. You can even make it so that it's possible to return the macro to whatever mode it was in before. The :lineReturnTest test enables delayed expansion ...
- 22 Sep 2024 09:36
- Forum: DOS Batch Forum
- Topic: help with multilinea macro in not delayed
- Replies: 4
- Views: 40427
Re: help with multilinea macro in not delayed
Hi einstein1969, I don't see the relation between delayed expansion and line feeds here. Using of line feeds in macros just depends on code blocks. It is essential to use the parenthesis in the macro. rem define a line feed for using in macro definitions (Set $\n=^^^ %= this line is required =% ) se...
- 13 Sep 2024 00:40
- Forum: DOS Batch Forum
- Topic: Observations about the tilde-dollar syntax %~$variable:I
- Replies: 3
- Views: 57076
Re: Observations about the tilde-dollar syntax %~$variable:I
After reading Batch: How to Properly Use CHOICE Inside of CALL Function? The problem was probably a previously set of the errorlevel variable. I was curious whether it is possible to recognize this programmatically. "if defined variableName" doesn't work here, because it's true for pseudovariables, ...
- 12 Sep 2024 11:10
- Forum: DOS Batch Forum
- Topic: scrolling region test
- Replies: 8
- Views: 58267
Re: scrolling region test
Hi,
a bit nitpicking
new functions: :chr, :asc, :asciiMap (Fri Apr 01, 2011 10:34 pm)
I probably developed the ESC, DEL and CR (buffer overflow) technique, but the rest was just a copy and paste.
jeb
a bit nitpicking

new functions: :chr, :asc, :asciiMap (Fri Apr 01, 2011 10:34 pm)
I probably developed the ESC, DEL and CR (buffer overflow) technique, but the rest was just a copy and paste.
jeb
- 07 Sep 2024 02:47
- Forum: DOS Batch Forum
- Topic: Observations about the tilde-dollar syntax %~$variable:I
- Replies: 3
- Views: 57076
Re: Observations about the tilde-dollar syntax %~$variable:I
1) Undefined variables and an empty variable names behave differently (#5 and #6). Perhaps an empty variable name accesses some random existing variable :?: After some more testing, I found the behavior for an empty searchPath-variable name. If you use the expression "%%~$:X" or ""%%~$====:X" the n...
- 06 Sep 2024 14:28
- Forum: DOS Batch Forum
- Topic: Observations about the tilde-dollar syntax %~$variable:I
- Replies: 3
- Views: 57076
Observations about the tilde-dollar syntax %~$variable:I
I would like to share some insights about the rarely used syntax of "%~$PATH:I" %~$PATH:I Searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first directory found. If the environment variable name isn't defined or the file isn't found b...
- 07 Aug 2024 08:34
- Forum: DOS Batch Forum
- Topic: Scope termination and echo state
- Replies: 1
- Views: 26460
Re: Scope termination and echo state
Hi mataha, I don't understand why you use the "(goto) 2>nul" at all. And starting another batch file without CALL ? The (goto) construct can be used as a special EXIT with quite different behavior. (goto) works like EXIT /B, it pops the program stack and rolls back all SETLOCAL to the old state when...
- 16 Jul 2024 00:59
- Forum: DOS Batch Forum
- Topic: Strange thing
- Replies: 2
- Views: 19477
Re: Strange thing
Hi miskox,
It's simply the "f" in "%%f ... iller%%"
You used %%f as your FOR-metavariable, change that or use another variable name
Code: Select all
for /L %%f in (1,1,78) do call set filler=%%char219%%%%filler%%
You used %%f as your FOR-metavariable, change that or use another variable name
- 15 Jul 2024 01:34
- Forum: DOS Batch Forum
- Topic: echo a for into a file?
- Replies: 3
- Views: 32094
Re: echo a for into a file?
Hi thousandsword, the problem is that all characters after the ECHO are still parsed and that results in this error. The first problem are the closing parentheses, but you can escape them with carets ( echo for /f "usebackq tokens=* delims=:" %%a in (`dir C:\myfolder\withmanyfiles\`^) do (echo File ...
- 21 Jun 2024 08:47
- Forum: DOS Batch Forum
- Topic: Weird behavior with CALL (function)
- Replies: 3
- Views: 19391
Re: Weird behavior with CALL (function)
Hi,
my first guess is: You use LF as line ending instead of CRLF.
This causes such suspicious behavior.
jeb
my first guess is: You use LF as line ending instead of CRLF.
This causes such suspicious behavior.
jeb