Search found 630 matches

by miskox
20 Nov 2024 08:42
Forum: DOS Batch Forum
Topic: The Daily Calendar Puzzle
Replies: 2
Views: 751

Re: The Daily Calendar Puzzle

Thanks! Looks great! I had to modify for /F "tokens=1-3 delims=/." %%a in ("%date%") do set /A "dd=1%%a%%100, mm=1%%b%%100, yyyy=%%c" to for /F "tokens=2-4 delims=/. " %%a in ("%date%") do set /A "dd=1%%a%%100, mm=1%%b%%100, yyyy=%%c" (added space as a delimiter, changed tokens from 1-3 to 2-4 becau...
by miskox
14 Nov 2024 02:22
Forum: DOS Batch Forum
Topic: SETX /M and PATH system variable
Replies: 1
Views: 743

Re: SETX /M and PATH system variable

Found it: see https://stackoverflow.com/questions/19287379/how-do-i-add-to-the-windows-path-variable-using-setx-having-weird-problems for /f "usebackq tokens=2,*" %A in (`reg query HKCU\Environment /v PATH`) do set my_user_path=%B setx PATH "C:\Python27;C:\Python27\Scripts;%my_user_path%" HCKU above...
by miskox
14 Nov 2024 01:43
Forum: DOS Batch Forum
Topic: SETX /M and PATH system variable
Replies: 1
Views: 743

SETX /M and PATH system variable

I would like to add a path (for example c:\test) to *system* variable (not user variable). Press WIN+R and type SystemPropertiesAdvanced and press ENTER. Click on 'environemnt variables'. At the top are user settings and at the bottom systemwide settings. And instead of adding a new path to the syst...
by miskox
04 Nov 2024 14:36
Forum: DOS Batch Forum
Topic: Foxidrive has left us
Replies: 44
Views: 211606

Re: Foxidrive has left us

8 years already. Time flies.

Saso
by miskox
23 Oct 2024 05:51
Forum: DOS Batch Forum
Topic: Why here echo double times?
Replies: 4
Views: 74649

Re: Why here echo double times?

Maybe you would like to know the explanation: Just run this: @echo off echo BEFORE for /L %%f in (1,1,3) do call :DOIT %%f echo AFTER goto :EOF :DOIT echo %1 goto :EOF Output: e:\>a BEFORE 1 2 3 AFTER e:\> As you can see FOR command calls : DOIT three times and then execution continues after this FO...
by miskox
22 Oct 2024 03:24
Forum: DOS Batch Forum
Topic: AutoMenu.bat: simple multi-level menu system (with a coherent help on Windows-DOS commands)
Replies: 16
Views: 42432

Re: AutoMenu.bat: simple multi-level menu system (with a coherent help on Windows-DOS commands)

In original version 1.4 change these lines (first and last are the same - just to be sure) (lines starting at line 131): set "choice=!choices:~%errorlevel%,1!" if not "%choice%"=="0" if not "%choice%"=="%LetterToExitMainMenu%" choice.exe /N /C YQ /M "Press Y to continue or Q to Quit: " if not "%erro...
by miskox
21 Oct 2024 09:43
Forum: DOS Batch Forum
Topic: AutoMenu.bat: simple multi-level menu system (with a coherent help on Windows-DOS commands)
Replies: 16
Views: 42432

Re: AutoMenu.bat: simple multi-level menu system (with a coherent help on Windows-DOS commands)

Version 1.5: @echo off setlocal EnableDelayedExpansion rem ================================================================== rem Automatic multi-level multi-option menu system rem Antonio Perez Ayala - 2022/02/09 rem version 1.2 - 2022/02/12 rem -----------------------------------------------------...
by miskox
21 Oct 2024 05:18
Forum: DOS Batch Forum
Topic: Progress bar
Replies: 6
Views: 23951

Re: Progress bar

Very good! Thanks.

Saso
by miskox
21 Oct 2024 02:45
Forum: DOS Batch Forum
Topic: AutoMenu.bat: simple multi-level menu system (with a coherent help on Windows-DOS commands)
Replies: 16
Views: 42432

Re: AutoMenu.bat: simple multi-level menu system (with a coherent help on Windows-DOS commands)

Thanks!

Quickly I would say that this line

Code: Select all

set "choice=!choices:~%errorlevel%,1!"
should be

Code: Select all

set "choice=!choices:~1,1!"
I will check everything else later today.

Saso
by miskox
17 Oct 2024 22:27
Forum: DOS Batch Forum
Topic: date and time format inconsistencies
Replies: 13
Views: 34532

Re: date and time format inconsistencies

Very good post at SO!

Thanks.

Saso
by miskox
17 Oct 2024 02:38
Forum: DOS Batch Forum
Topic: How to break from a .cmd?
Replies: 2
Views: 8487

Re: How to break from a .cmd?

Thanks.

Saso
by miskox
16 Oct 2024 23:00
Forum: DOS Batch Forum
Topic: How to break from a .cmd?
Replies: 2
Views: 8487

How to break from a .cmd?

I have 1.cmd: @call 2.cmd @echo HERE-1.cmd and I have 2.cmd @echo off for %%f in (a.a b.b c.c) do call :DOIT "%%f" echo END-2.cmd goto :EOF :DOIT set errlev=1 if not "%errlev%"=="0" echo ERROR %1.&exit /b echo TOO FAR goto :EOF Output: c:\> ERROR "a.a". ERROR "b.b". ERROR "c.c". END-2.cmd HERE-1.cmd...
by miskox
15 Oct 2024 11:53
Forum: DOS Batch Forum
Topic: How to set and make a range of values working in one function
Replies: 6
Views: 16368

Re: How to set and make a range of values working in one function

You could use this (see https://www.dostips.com/forum/viewtopic.php?p=70603#p70603) For /f %%a In ('WMIC Path Win32_LocalTime Get DayOfWeek /value ^|find "="') Do Set "%%a" instead of For /f %%a In ('WMIC Path Win32_LocalTime Get DayOfWeek^|Findstr [0-6]') Do ( Set DOW=%%a) Of course IF %DOW% should...
by miskox
13 Oct 2024 08:22
Forum: DOS Batch Forum
Topic: How to set and make a range of values working in one function
Replies: 6
Views: 16368

Re: How to set and make a range of values working in one function

Another FOR loop can't be used because you are inserting new string in a new line - and this increases number of lines. Try this: @echo off REM generate input file as we don't have it break>input.robot for /L %%f in (1,1,300) do echo %%f_ABCDEFG>>input.robot REM remove lines above - they are here ju...
by miskox
11 Oct 2024 01:40
Forum: DOS Batch Forum
Topic: How to set and make a range of values working in one function
Replies: 6
Views: 16368

Re: to set variable in a range of values

Maybe you could add another FOR loop to gor thru these values?

Saso