Search found 3695 matches

by aGerman
20 Dec 2019 07:04
Forum: DOS Batch Forum
Topic: CmdRunner - 3d game (CubeRunner clone)
Replies: 44
Views: 10020

Re: CmdRunner - 3d game (CubeRunner clone)

I assume you read Antonio's answer? You can't break a FOR /L loop in the running process. That might be a cmd.exe bug. But don't hope that it will be fixed. Microsoft explained several times that they won't update cmd.exe anymore.

Steffen
by aGerman
16 Dec 2019 11:41
Forum: DOS Batch Forum
Topic: Enable and Start Service on entire subnet remotely
Replies: 2
Views: 766

Re: Enable and Start Service on entire subnet remotely

Sounds to me like you just need a FOR /L loop and you are done

Code: Select all

for /l %%i in (1 1 254) do (
  sc \\192.168.100.%%i config remoteregistry start= auto
  sc \\192.168.100.%%i start remoteregistry
)
Steffen
by aGerman
16 Dec 2019 05:39
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 1091

Re: Using the rename command

It's not intended to close a topic. If you want to mark your question as solved you may edit your initial post and prepend something like [solved] to the subject.

Steffen
by aGerman
16 Dec 2019 05:34
Forum: DOS Batch Forum
Topic: use for loop to set local variable
Replies: 2
Views: 740

Re: use for loop to set local variable

for /r %%i in (*) do set "fn=%%~nxi" No need to define variable fn beforehand. Using %fn% in the assignment is probably not what you wanted, use the variable name instead of the variable value. Omit the spaces around the equal sign because they would lead to variable names having a space appended a...
by aGerman
16 Dec 2019 05:07
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 1091

Re: Using the rename command

I updated the code. There have been two useless variables.

Steffen
by aGerman
16 Dec 2019 03:17
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 1091

Re: Using the rename command

This code only displays the RENAME command line. Remove ECHO and PAUSE to make it rename the file. @echo off &setlocal DisableDelayedExpansion set "file=Encoder_TestHarnessLog_19_12_13-083023.xml" set "prefix=Test1" for %%i in ("%file%") do ( for /f "tokens=2* delims=_" %%j in ("%%~nxi") do ( ECHO r...
by aGerman
15 Dec 2019 10:38
Forum: DOS Batch Forum
Topic: xls , calc , xlsx to xml with unicod fonts
Replies: 1
Views: 685

Re: xls , calc , xlsx to xml with unicod fonts

It's not about the font, it's all about character encoding in your source file. Without knowing which charset is used I can't even give you any advice. It will get complicated anyway.

Steffen
by aGerman
15 Dec 2019 10:34
Forum: DOS Batch Forum
Topic: SPEAK.BAT speech script (JScript hybrid)
Replies: 0
Views: 1163

SPEAK.BAT speech script (JScript hybrid)

We already have a couple of threads about speech output. E.g. https://www.dostips.com/forum/viewtopic.php?f=3&t=6841&p=44362 https://www.dostips.com/forum/viewtopic.php?f=3&t=9365&p=60816 https://www.dostips.com/forum/viewtopic.php?f=3&t=7785&p=51864 https://www.dostips.com/forum/viewtopic.php?f=3&t...
by aGerman
13 Dec 2019 08:15
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 1091

Re: Using the rename command

In this case you should provide a real example how it looks like before and after renaming (e.g. the number of underscores could be critical here), plus the rules of how to get from the old name to the new (e.g. does the new name always begin with "Test1_").

Steffen
by aGerman
11 Dec 2019 12:00
Forum: DOS Batch Forum
Topic: Split string to characters
Replies: 31
Views: 11253

Re: Split string to characters

And sort of confirms that the weird cmd.exe design --- if any --- is really rocket science! :? The CMD is buggy as hell and Microsoft is absolutely aware of that. When I called it an "evil beast", Michael Niksa (one of the Console/Terminal core developers) agreed with me :D However, the decision of...
by aGerman
11 Dec 2019 07:45
Forum: DOS Batch Forum
Topic: The most primitive XML writer (just for fun)
Replies: 7
Views: 1010

Re: The most primitive XML writer (just for fun)

I think this is what I already understood.
My question is why

Code: Select all

if "%~2" == "/" if [%2] == [/] (
and why not just

Code: Select all

if "%~2" == "/" (
So, what problems do you expect that you need the double check (the two IF statements in a row)?

Steffen
by aGerman
10 Dec 2019 14:04
Forum: DOS Batch Forum
Topic: The most primitive XML writer (just for fun)
Replies: 7
Views: 1010

Re: The most primitive XML writer (just for fun)

Nice little exercise :)

Could you explain the reason for the double check in lines like that? :

Code: Select all

if "%~2" == "/" if [%2] == [/] (
Steffen
by aGerman
10 Dec 2019 13:47
Forum: DOS Batch Forum
Topic: Split string to characters
Replies: 31
Views: 11253

Re: Split string to characters

Goodness, I always thought that the result would have been "~0,1". Never thought about that only one percent sign was removed because you usually don't see the second either. Thanks for pointing.

Steffen
by aGerman
10 Dec 2019 11:07
Forum: DOS Batch Forum
Topic: Get numeric name of current folder, add 1 to it?
Replies: 1
Views: 659

Re: Get numeric name of current folder, add 1 to it?

Say, today is Dec., 31st 2019. How does the path look like for tomorrow? And are zeros prepended to one-digit months and days?

Steffen