Search found 4560 matches
- 03 Jul 2025 10:59
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 27
- Views: 134576
Re: strLen boosted
It's been too hot to do anything outdoors yesterday. So I came back to this old topic because I remembered Antonio came up with something new last year. I made a few performance comparisons. I turns out that this technique is unfortunately slower than the latest that sowgtsoi posted. Francesco's ada...
- 03 Jul 2025 09:56
- Forum: DOS Batch Forum
- Topic: VBS returns localized TRUE/FALSE
- Replies: 2
- Views: 18
Re: VBS returns localized TRUE/FALSE
You can cast the boolean values in VBS already (using the cint function). This way FALSE becomes 0 and TRUE becomes -1. This said, you should really make the vbs scan the whole file at once. Calling cscript for every line will be horribly slow. Or use JREPL.bat or any other tool with better regex su...
- 01 Jul 2025 12:46
- Forum: DOS Batch Forum
- Topic: Get set /p to accept file suffix.
- Replies: 11
- Views: 120
Re: Get set /p to accept file suffix.
The strategy is simple. 1) If a dot is found in %Suffix%, remove everything that comes before including the dot itself. So "*.xls", ".xls" and "xls" all become "xls" in the first SET statement. (For more information run SET /? and read about environment variable substitution.) 2) Because Get-ChildIt...
- 30 Jun 2025 15:05
- Forum: DOS Batch Forum
- Topic: Get set /p to accept file suffix.
- Replies: 11
- Views: 120
Re: Get set /p to accept file suffix.
Screenshot 2025-06-30 224917.png Screenshot 2025-06-30 225044.png As you can see, SET /P just assignes whatever the user enters. It cannot do anything else. I f you insert these two lines after your SET /P set "Suffix=%Suffix:*.=%" set "Suffix=*.%Suffix%" it doesn't matter if the user omits the ast...
- 30 Jun 2025 12:01
- Forum: DOS Batch Forum
- Topic: Get set /p to accept file suffix.
- Replies: 11
- Views: 120
Re: Get set /p to accept file suffix.
I doubt that this is a cmd issue. It's just the way how the -Filter parameter of the PowerShell Get-ChildItem cmdlet works. It needs the asterisk as a wildcard for the file name. So, what are you trying to do? Manually prepend the asterisk whenever the user didn't enter it?
Steffen
Steffen
- 29 Jun 2025 04:11
- Forum: DOS Batch Forum
- Topic: Get set /p to accept file suffix.
- Replies: 11
- Views: 120
Re: Get set /p to accept file suffix.
Can't repro.
Steffen
Code: Select all
@echo off &setlocal
set "User_Input="
set /p "User_Input=>Enter the 'File Type' [Suffix] including the decimal point and Asterix if applicable and press <Enter>: "
echo %User_Input%
pause
- 22 Jun 2025 06:38
- Forum: DOS Batch Forum
- Topic: How to overcome 32-bits math limitation of BAT if PS1 workaround alerts HIPS repeatedly?
- Replies: 5
- Views: 292
Re: How to overcome 32-bits math limitation of BAT if PS1 workaround alerts HIPS repeatedly?
Your uncommon 4-digit grouping works incorrectly. It repeats the last digit of the previous group as first digit in the next group. *.ps1 $NUMBER_A = [System.Decimal]1000000000000000000 $NUMBER_B = [System.Decimal]200000000000000000 $Result_in_bytes = $NUMBER_A - $NUMBER_B $KB = $Result_in_bytes / 1...
- 05 Jun 2025 09:35
- Forum: DOS Batch Forum
- Topic: Folder Deletion
- Replies: 1
- Views: 369
Re: Folder Deletion
It's not quite clear to me what you're trying to do. However, you could try something like that: @echo off for /d /r "C:\Users\user\somewhere" %%p in ("*.orph") do ECHO rmdir "%%p" /s /q PAUSE Update the path after the /r option accordingly and run it. The script doesn't do any harm yet, it only dis...
- 01 Jun 2025 11:16
- Forum: DOS Batch Forum
- Topic: Stack Overflow article.
- Replies: 5
- Views: 3032
Re: Stack Overflow article.
Forty years ago, my father used to say, "You young people are getting dumber and dumber. I know the multiplication tables by heart. You even enter 5x5 into your pocket calculator." My father was totally right. Sometimes I can't recall parts of the multiplication tables. Why? Because I don't frequent...
- 20 May 2025 10:45
- Forum: DOS Batch Forum
- Topic: edit command (CLI text editor) returns to Windows
- Replies: 3
- Views: 8956
Re: edit command (CLI text editor) returns to Windows
Thanks for the short notice. I've updated the topic to let the younger audience know that this is a feature that dates back to the old days, before 64-bit machines became common. The edit.com editor was a 16-bit tool that (if I recall correctly) was still shipped with the 32-bit version of Windows 7...
- 11 May 2025 16:20
- Forum: DOS Batch Forum
- Topic: Accessing the Control Panel.
- Replies: 8
- Views: 1849
Re: Accessing the Control Panel.
I checked all menu items in the English version. All work as expected. One minor flaw in the graphics - the date format is localized (like many other things in Batch). In my environment it's only 10 characters DD.MM.YYYY. Something like %DATE:~0,15% can't make it longer. Fixing this is easy though. ...
- 11 May 2025 12:49
- Forum: DOS Batch Forum
- Topic: Accessing the Control Panel.
- Replies: 8
- Views: 1849
Re: Accessing the Control Panel.
The subroutine comes at the very end of your script, after your current code. Calling it to initialize the macro somewhere at the beginning, e.g. after @echo off or after setlocal. (The explanation about the meaning of the "magic numbers" is of course only a comment for those who are interested in w...
- 11 May 2025 08:53
- Forum: DOS Batch Forum
- Topic: Accessing the Control Panel.
- Replies: 8
- Views: 1849
Re: Accessing the Control Panel.
I just hope that the script really directs to the right interfaces That's precisely what I want to know. Don't worry. If it works in Spanish, then it works in any other language as well. The parameters you pass to get to the different interfaces are not localized. Actually, what I want is to preven...
- 11 May 2025 03:53
- Forum: DOS Batch Forum
- Topic: Accessing the Control Panel.
- Replies: 8
- Views: 1849
Re: Accessing the Control Panel.
Hello Eduardo, I'm running the latest Windows 11 with German language settings. However, it seems to work and out of my experience it should work on Win 10 English as well in that case. As I don't speak Spanish, I just hope that the script really directs to the right interfaces. Just to add... - Peo...
- 04 May 2025 04:20
- Forum: DOS Batch Forum
- Topic: …and we’re back!
- Replies: 3
- Views: 3615
Re: …and we’re back!
The certificate expires once after three months, the admin said. Usually it gets renewed automatically. It's unknown why it didn't happen to work this time.