Search found 98 matches

by jfl
11 Apr 2019 06:24
Forum: DOS Batch Forum
Topic: Command only listing active NIC?
Replies: 2
Views: 78

Re: Command only listing active NIC?

I have a script that does just that: ipcfg.bat , part of my System Tools Library ipcfg.bat has lots of options. But the idea is to select only "interesting" network information. By default, it outputs just the information for the active NICs, as you're trying to do. Examples: C:\JFL\Temp>ipcfg -l Et...
by jfl
04 Apr 2019 03:00
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 16
Views: 469

Re: Ipconfig doesn't work inside a bat file

None of the Microsoft ping programs (ping, pathping, psping) output: Enter the ping options: I tried that on several of my systems, with various Windows versions, and indeed none of them contain that string. Ex: C:\JFL\Temp>strings C:\Windows\System32\ping.exe | findstr /i please C:\JFL\Temp>string...
by jfl
02 Apr 2019 09:44
Forum: DOS Batch Forum
Topic: which.exe v1.12 - Now efficiently detecting doskey macros and PS aliases
Replies: 4
Views: 305

Re: which.exe v1.12 - Now efficiently detecting doskey macros and PS aliases

That's a neat tool, I like it :) Thanks! I have a question as to how option -a is intended to work. If I run 'which -a cmd.exe' I was expecting that more than one file was found on my Win10 x64. Also if I run it in the WOW64 subsystem, it reports that cmd.exe was found in System32, which isn't wron...
by jfl
26 Mar 2019 12:54
Forum: DOS Batch Forum
Topic: which.exe v1.12 - Now efficiently detecting doskey macros and PS aliases
Replies: 4
Views: 305

which.exe v1.12 - Now efficiently detecting doskey macros and PS aliases

Announcing an updated version of my which.exe tool, for searching which programs will run at the command.com, cmd.exe, or PowerShell prompts. This which.exe program strives to implement the best of both Unix which and Windows where.exe, and a bit more! which_v1.12.zip Note about the new option -i in...
by jfl
12 Mar 2019 03:33
Forum: DOS Batch Forum
Topic: UTF-8 bug
Replies: 19
Views: 1024

Re: UTF-8 bug

Arriving a bit late in this thread, but hopefully with a few interesting links: The console always works in UCS-2 mode, whatever the code page you're using. That is is records 16-bits Unicode version 1 characters in each cell. Ascii or non-ascii is irrelevant: Ascii is just the first 128 Unicode cha...
by jfl
12 Feb 2019 07:17
Forum: DOS Batch Forum
Topic: findstr /C:""" file.txt&&set found=1 FAILS
Replies: 6
Views: 325

Re: findstr /C:""" file.txt&&set found=1 FAILS

The ^ escaping works outside of quoted strings. Inside quoted strings, ^ is a normal character. ^""" passes """ to the findstr.exe program "^"" passes "^"" to the findstr.exe program Same thing for the ^| character in your first example. It's inside a quoted string, so 1) The ^ is useless, as | bein...
by jfl
12 Feb 2019 04:53
Forum: DOS Batch Forum
Topic: Set Window Topmost (Powershell hybrids)
Replies: 4
Views: 280

Re: Set Window Topmost (Powershell hybrids)

Actually triple language Batch+PowerShell+C# macros. Impressive! :D

And the performance is actually better than what I feared. (About 0.5s per macro invocation on my system.)
This opens up infinite possibilities with all the .NET framework at hand.
by jfl
12 Feb 2019 04:26
Forum: DOS Batch Forum
Topic: How do I rerun AUTOEXEC?
Replies: 2
Views: 168

Re: How do I rerun AUTOEXEC?

autoexec.bat was a feature of MS-DOS. Are you still using MS-DOS? Windows XP and later are not based on MS-DOS, and do not run autoexec.bat by default. (Unless maybe you have changed the Windows Command Prompt's startup command to something like: %windir%\system32\cmd.exe /k "C:\autoexec.bat") Anywa...
by jfl
12 Feb 2019 04:14
Forum: DOS Batch Forum
Topic: findstr /C:""" file.txt&&set found=1 FAILS
Replies: 6
Views: 325

Re: findstr /C:""" file.txt&&set found=1 FAILS

You have an odd number of quotes in your request. So everything that follows the third one is passed to findstr as a single argument. To fix that, you have to ^escape one of the quotes, so that cmd.exe parses it as a normal character: C:\JFL\Temp>C:\JFL\Temp>findstr /C:^""" file.txt Some more text w...
by jfl
11 Feb 2019 06:04
Forum: DOS Batch Forum
Topic: Call and goto may fail when the batch file has Unix line endings
Replies: 16
Views: 756

Re: Call and goto may fail when the batch file has Unix line endings

jeb wrote:
11 Feb 2019 05:19
BUT the scanner is able to set the new file position to the wrong position after a label is found :!:
Here, it seems that the line scanner simply assumes that a line cannot be longer than 512 bytes.
And whatever follows is just another line.
by jfl
11 Feb 2019 05:45
Forum: DOS Batch Forum
Topic: Call and goto may fail when the batch file has Unix line endings
Replies: 16
Views: 756

Re: Call and goto may fail when the batch file has Unix line endings

@jeb and @dbenham: Bravo, you've progressed beyond my wildest dreams, while I was busy on other things. The magic of the Internet :D the scanner is able to set the new file position to the wrong position after a label is found :!: Yes, that's actually the initial failure mode I had, with a call endi...
by jfl
06 Feb 2019 10:15
Forum: DOS Batch Forum
Topic: Call and goto may fail when the batch file has Unix line endings
Replies: 16
Views: 756

Call and goto may fail when the batch file has Unix line endings

Hi, I had a crazy problem this morning after doing a minor fix of my AutoRun.cmd script for XP. The fix was working fine. Before committing the updated version, I added a comment in the file header. One last test running 'AutoRun -l' and... BOOM :x Of course, I first thought that AutoRun.cmd itself ...
by jfl
06 Feb 2019 03:18
Forum: DOS Batch Forum
Topic: Is there any standard equivalent of a .bashrc script for cmd?
Replies: 10
Views: 534

Re: Is there any standard equivalent of a .bashrc script for cmd?

An interesting application of previous work on this forum: Create a file called "%ALLUSERSPROFILE%\AutoRun.cmd.d\pid.bat", containing: @echo off call :getPID PID exit /b :getPID [RtnVar] :: :: Store the Process ID (PID) of the currently running script in environment variable RtnVar. :: If called wit...
by jfl
05 Feb 2019 16:18
Forum: DOS Batch Forum
Topic: Is there any standard equivalent of a .bashrc script for cmd?
Replies: 10
Views: 534

Re: Is there any standard equivalent of a .bashrc script for cmd?

@jeb I had severe difficulties distinguishing "normal" cmd.exe invokations from for /f invokations. First, on my system, in the normal case, CMDCMDLINE does not just contain "C:\Windows\system32\cmd.exe". Sometimes it is: set "CMDCMDLINE="C:\WINDOWS\system32\cmd.exe" " (Notice the additional quotes ...
by jfl
05 Feb 2019 08:24
Forum: DOS Batch Forum
Topic: Bget - A package Manager for Windows scripts.
Replies: 4
Views: 602

Re: Bget - A package Manager for Windows scripts.

Hi jahwi, I tried your bget package manager last month, and found it very interesting. Since then I've been working on a way to manage multiple independent AutoRun files, that create batch variables and macros for all new cmd.exe windows. This management is done by an AutoRun.cmd script. I thought t...