Search found 631 matches
- 01 Dec 2024 06:56
- Forum: DOS Batch Forum
- Topic: is there a way to implement so called "record" and "field" data structure?
- Replies: 5
- Views: 765
Re: is there a way to implement so called "record" and "field" data structure?
Why don't you make an example of what your output file should look like? We are all trying to guess. I guess you are looking for a .txt file (you can call it a .csv file if you want): field1;field2;field3:field4;field5; field1;field2;field3:field4;field5; field1;field2;field3:field4;field5; field1;f...
- 20 Nov 2024 08:42
- Forum: DOS Batch Forum
- Topic: The Daily Calendar Puzzle
- Replies: 3
- Views: 3371
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...
- 14 Nov 2024 02:22
- Forum: DOS Batch Forum
- Topic: SETX /M and PATH system variable
- Replies: 1
- Views: 2979
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...
- 14 Nov 2024 01:43
- Forum: DOS Batch Forum
- Topic: SETX /M and PATH system variable
- Replies: 1
- Views: 2979
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...
- 04 Nov 2024 14:36
- Forum: DOS Batch Forum
- Topic: Foxidrive has left us
- Replies: 44
- Views: 217735
Re: Foxidrive has left us
8 years already. Time flies.
Saso
Saso
- 23 Oct 2024 05:51
- Forum: DOS Batch Forum
- Topic: Why here echo double times?
- Replies: 4
- Views: 81987
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...
- 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: 47206
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...
- 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: 47206
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 -----------------------------------------------------...
- 21 Oct 2024 05:18
- Forum: DOS Batch Forum
- Topic: Progress bar
- Replies: 6
- Views: 26947
Re: Progress bar
Very good! Thanks.
Saso
Saso
- 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: 47206
Re: AutoMenu.bat: simple multi-level menu system (with a coherent help on Windows-DOS commands)
Thanks!
Quickly I would say that this line
should be
I will check everything else later today.
Saso
Quickly I would say that this line
Code: Select all
set "choice=!choices:~%errorlevel%,1!"
Code: Select all
set "choice=!choices:~1,1!"
Saso
- 17 Oct 2024 22:27
- Forum: DOS Batch Forum
- Topic: date and time format inconsistencies
- Replies: 13
- Views: 37872
Re: date and time format inconsistencies
Very good post at SO!
Thanks.
Saso
Thanks.
Saso
- 17 Oct 2024 02:38
- Forum: DOS Batch Forum
- Topic: How to break from a .cmd?
- Replies: 2
- Views: 11256
Re: How to break from a .cmd?
Thanks.
Saso
Saso
- 16 Oct 2024 23:00
- Forum: DOS Batch Forum
- Topic: How to break from a .cmd?
- Replies: 2
- Views: 11256
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...
- 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: 19246
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...
- 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: 19246
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...