Search found 19 matches

by CJM
14 Sep 2022 14:13
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 44
Views: 214038

Re: ECHO. FAILS to give text or blank line - Instead use ECHO/

... It's a problem of the CALL, it's independent of the command, because the command is never be used, when the CALL detects the /? before. ... Agreed, since CALL is the one intercepting with its own help (or not passing on the CALLed command I should say). I was pointing out the interesting behavi...
by CJM
01 Sep 2022 18:17
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 44
Views: 214038

Re: ECHO. FAILS to give text or blank line - Instead use ECHO/

... In my opinion, there is a champion: echo( It's the most reliable in most of the cases. It fails only with: :case1 call echo( /? ... I see. "call echo( /?" apparently suffers from the same issue I mentioned which suggests there might be a way to escape it somehow: Fails: call echo( /? Works: cal...
by CJM
29 Aug 2022 23:46
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 44
Views: 214038

Re: ECHO. FAILS to give text or blank line - Instead use ECHO/

This subject seemed to tail off without resolution, yet using ECHO to reliably display information is such a necessity. ... fails, if a file in the current directory exists named my.bat echo\..\my.bat echo:\..\my.bat echo.\..\my.bat ... ... The echo:\..\my.bat behavior really blows my mind. :shock: ...
by CJM
15 Dec 2021 12:45
Forum: DOS Batch Forum
Topic: Finding /? in arguments
Replies: 7
Views: 4916

Re: Finding /? in arguments

I wrote this one-liner to handle (only in the first argument) the help command option in batch files: @For %%? in ("" : - /)do @IF %%~??==%1 GOTO:Help ... :Help ... It supports whatever leading switch characters you want to allow (in the FOR command set, except "*" which triggers a wildcard replacem...
by CJM
29 Jun 2021 16:56
Forum: DOS Batch Forum
Topic: Why does this run net1.exe?
Replies: 15
Views: 12824

Re: Why does this run net1.exe?

Also, since "n<<<<<<" matches an ".exe"-file, i would expect "n<<<<<<.exe" to match the same executable, but on my system the first executes "C:\Windows\Notepad.exe" while the last starts "C:\Windows\System32\Narrator.exe". Yes, but while "n<<<<<<" does indeed match an ".exe"-file, that's not the F...
by CJM
28 Jun 2021 14:23
Forum: DOS Batch Forum
Topic: How to move selected files to a specific folder using a Windows batch file?
Replies: 2
Views: 3341

Re: How to move selected files to a specific folder using a Windows batch file?

Create a shortcut to your batch file in the Send To folder, which is easily opened from the command line with: start shell:sendto Then you can right-click on your selected files, click Send To ; [your shortcut name] The batch file will receive the list of files as arguments, which you can iterate th...
by CJM
28 Jun 2021 06:34
Forum: DOS Batch Forum
Topic: Why does this run net1.exe?
Replies: 15
Views: 12824

Re: Why does this run net1.exe?

... My PATH variable contains ";C:\WINDOWS\system32;C:\WINDOWS;" in that order, so it should search system32 folder first... On my system as well, except if I DIR "C:\Windows\System32\no*****.*" , the first file (of 11) returned is NOISE.DAT , causing PATHEXT to be searched for: NOISE.D.COM , NOISE...
by CJM
28 Jun 2021 06:19
Forum: DOS Batch Forum
Topic: Why does this run net1.exe?
Replies: 15
Views: 12824

Re: Why does this run net1.exe?

... executing "C:\Windows\notepad.exe", you get that different icon. I just tried that, and it sure does. That's so weird, especially since it's a hardlink, effectively pointing to the SAME file! >fsutil hardlink list C:\windows\notepad.exe \Windows\notepad.exe \Windows\System32\notepad.exe \Window...
by CJM
28 Jun 2021 06:10
Forum: DOS Batch Forum
Topic: Why does this run net1.exe?
Replies: 15
Views: 12824

Re: Why does this run net1.exe?

Adding the file "netbios.dll" to that folder makes it the first listed using 'dir "n<s.*"', but it doesn't execute net.exe (at least on my system). I tried your scenario, adding my \Test directory to the PATH before any \Windows paths, then I started with the current directory as %UserProfile%: >"n...
by CJM
28 Jun 2021 05:22
Forum: DOS Batch Forum
Topic: Why does this run net1.exe?
Replies: 15
Views: 12824

Re: Why does this run net1.exe?

... in the taskbar, the notepad window does not have the notepad icon. Whoa! I didn't notice that. Good catch! I'm betting the icon resource lookup doesn't recognize wildcards. This extends to Task Manager's Details pane where if you look-up the Properties of that task, the Properties window also h...
by CJM
27 Jun 2021 18:10
Forum: DOS Batch Forum
Topic: Why does this run net1.exe?
Replies: 15
Views: 12824

Re: Why does this run net1.exe?

While i agree with most you said, there is a nitpick. I have a file named "netbios.dll" in "C:\Windows\System32". Therefore "n<s" should also trigger the execution of "net.exe" on my system, but it doesn't. On your system, what is the FIRST file returned from: DIR "%Windir%\System32\n<s.*" If you f...
by CJM
27 Jun 2021 16:15
Forum: DOS Batch Forum
Topic: Why does this run net1.exe?
Replies: 15
Views: 12824

Re: Why does this run net1.exe?

What's happening here has been nagging me for over a year now, with seemingly so random results I didn't even post about it because I couldn't even formulate how to say what I've been seeing. I finally took some time to test and observe on my current Windows 10 system (unless otherwise indicated). H...
by CJM
21 Jun 2021 07:44
Forum: DOS Batch Forum
Topic: Some undocumented things with turned off command extensions
Replies: 14
Views: 13649

Re: Some undocumented things with turned off command extensions

GOTO :EOF will work with extensions disabled, but :EOF must be in capitals. I cannot get GOTO :EOF (nor GOTO:EOF, with or without space, in all-caps) to function with DisableExtensions unless an :EOF (or :eof) label is present. I tested: - on both Windows 2000 [5.00.2195] and Windows 10 [10.0.19042...
by CJM
21 Feb 2021 19:12
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11437

Re: Best way to setup a "Dictionary" similar to VBA?

For a quick lookup list, I use the name.ext variable parsers %~n and %~x, adding a . before the lookup value like this example which expands the 3-letter abbreviation for day-of-week to the full word: @ FOR %%T in ( %DATE% )do @ FOR %%D in ( Sunday.Sun Monday.Mon Tuesday.Tue Wednesday.Wed Thursday.T...
by CJM
25 Oct 2020 19:47
Forum: DOS Batch Forum
Topic: Creating a custom html generator in batch
Replies: 9
Views: 8385

Re: Creating a custom html generator in batch

If you can do with the limit of not being able to use ? and * wildcard characters, I use a simple routine that leverages the command parser and FOR command. Save this as EchoArgs.cmd : @ For %%* in (%* %= Process each argument as a separate line. Arguments containing "poison"/whitespace must be quot...