Thanks again!
You always have a clever solution (short and efficient).
Saso
Search found 656 matches
- 20 Feb 2025 00:54
- Forum: DOS Batch Forum
- Topic: disable x button
- Replies: 10
- Views: 13565
- 19 Feb 2025 11:52
- Forum: DOS Batch Forum
- Topic: disable x button
- Replies: 10
- Views: 13565
Re: disable x button
I checked your FOR solution. It is great. And as you mention I can add additional check for the current directory.
The idea with the 2>nul is also great.
Thanks for the help.
Saso
The idea with the 2>nul is also great.
Thanks for the help.
Saso
- 19 Feb 2025 01:45
- Forum: DOS Batch Forum
- Topic: disable x button
- Replies: 10
- Views: 13565
Re: disable x button
Thanks Steffen. Of course code could be shortened: disableX.exe 1 set errlev=%errorlevel% if "%errlev%"=="99" if "%username%"=="JOHN" disableX.exe if "%errlev%"=="99" if "%username%"=="JANE" disableX.exe if "%errlev%"=="99" if "%username%"=="MARY" disableX.exe if "%errlev%"=="99" if "%username%"=="J...
- 18 Feb 2025 11:20
- Forum: DOS Batch Forum
- Topic: disable x button
- Replies: 10
- Views: 13565
Re: disable x button
Thanks Steffen! I don't think there is a need for an assembler code. C would do - even if .exe is bigger in size. Maybe just adding an IF: if parameter1="1" then exit 99 So if I execute disableX.exe 1 if "%errorlevel%"=="99" echo DISABLEX found. set disablex_exists=0 disableX.exe 1 if "%errorlevel%"...
- 17 Feb 2025 16:38
- Forum: DOS Batch Forum
- Topic: disable x button
- Replies: 10
- Views: 13565
Re: disable x button
I find this disablex.exe very useful now. But I have a problem: I would like to check if disablex.exe is in the path so I would need something like disablex.exe /v /v version info or something - so running the .exe does not disable the 'X'. If disablex.exe is not in the path I get errorlevel=9009 bu...
- 12 Feb 2025 13:02
- Forum: DOS Batch Forum
- Topic: Dos Batch Math Library
- Replies: 73
- Views: 259052
Re: Dos Batch Math Library
Could
10000*y/10/2
be written as
500*y ? Or it doesn't work as /5 did not?
(I am on a Phone and can't test this at the moment)
Saso
- 05 Feb 2025 01:34
- Forum: DOS Batch Forum
- Topic: how to get the string after "REG_SZ" or "REG_DWORD"?
- Replies: 6
- Views: 7583
Re: how to get the string after "REG_SZ" or "REG_DWORD"?
Here are two methods: string replacement or FOR. @echo off echo method 1 echo # should not be in the folder name or file name. Should be changed otherwise. set value1=W:\\Dune 2 - Remake\\dunedynasty.exe REG_SZ WINXPSP3 echo value1=%value1% set value2=%value1: REG_SZ =#% set value2=%value1: REG_DWOR...
- 20 Jan 2025 02:55
- Forum: DOS Batch Forum
- Topic: Use Netsh to save ip gw dns to variables for project
- Replies: 6
- Views: 8451
Re: Use Netsh to save ip gw dns to variables for project
Please use code tags. See set /? where Environment variable substitution has been enhanced as follows: %PATH:str1=str2% would expand the PATH environment variable, substituting each occurrence of "str1" in the expanded result with "str2". "str2" can be the empty string to effectively delete all occu...
- 09 Dec 2024 12:19
- Forum: DOS Batch Forum
- Topic: is there a way for echo (coordinate row, coordinate column)?
- Replies: 4
- Views: 10334
Re: is there a way for echo (coordinate row, coordinate column)?
You have two options:
- use escape sequences
- use space as a filler in your strings
Saso
- use escape sequences
- use space as a filler in your strings
Saso
- 04 Dec 2024 05:01
- Forum: DOS Batch Forum
- Topic: is there a way to implement so called "record" and "field" data structure?
- Replies: 11
- Views: 18715
Re: is there a way to implement so called "record" and "field" data structure?
I am not sure if I understand exactly what are you trying to do. But anyway: For example: you enter your data (for example with SET /P) and then write it to the output file. This means that you have your input file. Now you enter your 'key' (line number in this input file). Now depends what are you ...
- 01 Dec 2024 06:56
- Forum: DOS Batch Forum
- Topic: is there a way to implement so called "record" and "field" data structure?
- Replies: 11
- Views: 18715
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: 14767
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: 11474
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: 11474
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: 278393
Re: Foxidrive has left us
8 years already. Time flies.
Saso
Saso