Search found 177 matches

by jfl
16 Jul 2021 10:14
Forum: DOS Batch Forum
Topic: [How-To] Screenshot of Batch window (PowerShell hybrid)
Replies: 4
Views: 326

Re: [How-To] Screenshot of Batch window (PowerShell hybrid)

FYI, in my Systems Tools Library , there's a Get-Console.ps1 script which captures the console window, and puts it into the clipboard. By default, it captures it as HTML with colors . This makes it easy to capture a command output, and paste it into an email or post it on a server. Also the fact tha...
by jfl
20 Jun 2021 11:55
Forum: DOS Batch Forum
Topic: Improvements to my tools supporting multiple encodings
Replies: 6
Views: 786

Re: Improvements to my tools supporting multiple encodings

Hi Steffen, Yes, I'm definitely still interested, thanks for sharing your work like this. It's just that I have had less time for working on this lately, as it's the high season for one of my other passions. (Here's what I was doing on Wednesday instead of working 8) .) I'll resume serious work on t...
by jfl
19 Jun 2021 12:11
Forum: DOS Batch Forum
Topic: [Solved] How to delete a file with zero byte created accidentally with name "Call" on Windows ?
Replies: 2
Views: 516

Re: [Solved] How to delete a file with zero byte created accidentally with name "Call" on Windows ?

That kind of problem happened to me a few times already. Usually because I had typed Windows cmd.exe commands by mistake in the Linux subsystem Bash prompt. Recently I created like this a file called NUL, which I had a hard time deleting when I finally noticed it on the Windows side of things :oops:...
by jfl
02 Jun 2021 15:23
Forum: DOS Batch Forum
Topic: Improvements to my tools supporting multiple encodings
Replies: 6
Views: 786

Improvements to my tools supporting multiple encodings

Hello, I'm still trying to improve the automatic support for multiple text file encodings in my System Tools library . Two things need improvements now: The new Windows Terminal can now display all Unicode characters, including those beyond the 16-bits plane 0. I thought that my method of using UTF-...
by jfl
16 Apr 2021 15:43
Forum: DOS Batch Forum
Topic: Windows (and Office?) product key finder
Replies: 13
Views: 2179

Re: Windows (and Office?) product key finder

T3RRY wrote:
12 Apr 2021 19:54
You could simply use:

Code: Select all

wmic  path softwarelicensingservice get OA3xOriginalProductKey | findstr /r ".....-"
This does not work for me. I tested it on 5 different systems, with different versions of Windows, and it either returns nothing, or a WMI query error.
by jfl
16 Apr 2021 15:36
Forum: DOS Batch Forum
Topic: Clobbered cmd.exe!
Replies: 7
Views: 1730

Re: Clobbered cmd.exe!

Or you can open a PowerShell. You don't need cmd for that. Then everything will be usable normally, except batch files.
by jfl
22 Feb 2021 09:10
Forum: DOS Batch Forum
Topic: Apostrophe at beginning of file name
Replies: 6
Views: 2250

Re: Apostrophe at beginning of file name

A few more observations: 1) The problem is not related to the use of the usebackq option. Even without it, I get the very same error for 11-bytes file names: C:\JFL\SRC\Batch\dostips>for /f "delims=" %G IN ('myfile.txt) do @echo %G 'myfile.txt line 1 The system cannot find the file 쾻뭂ᨀ耀∟. C:\JFL\SRC...
by jfl
22 Feb 2021 07:33
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 4255

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

Except that with real files, it's much slower, and very fragile: If other files have one of these extensions, the code will break.
by jfl
21 Feb 2021 11:40
Forum: DOS Batch Forum
Topic: Interpret json with batch
Replies: 4
Views: 1834

Re: Interpret json with batch

There's also this beautiful example that aGerman posted last month:
In "JSON file in wrong format" post #4
It is also a Batch/JScript hybrid, and the JScript part creates an HTML object, to use its JSON decoding capabilities.
by jfl
15 Feb 2021 07:55
Forum: DOS Batch Forum
Topic: How to use the output of my first command in my second command in one step?
Replies: 5
Views: 2091

Re: How to use the output of my first command in my second command in one step?

This can be done easily using helper scripts: $.bat , described in this thread . regx.bat , from that same System Tools Library. regx.bat makes it easy to get the content of a registry value. It works as if the registry were a filesystem, with keys as directories, and values as files: regx type HKCU...
by jfl
09 Feb 2021 08:31
Forum: DOS Batch Forum
Topic: Cmd.exe bug with special characters
Replies: 2
Views: 1616

Re: Cmd.exe bug with special characters

This is because %0 is the command string you typed, not the actual script name. In the first case, it's quoted, so the special characters do not confuse the echo command. In the second case, it's not quoted, and the special & and ( characters (which have lost their protecting ^ at this stage) do con...
by jfl
08 Feb 2021 01:42
Forum: DOS Batch Forum
Topic: How to get rid of the extra character ahead of the title
Replies: 11
Views: 2896

Re: How to get rid of the extra character ahead of the title

Yes, VT sequences came again with the new console on Win 10. If you need something more downward compatible, try wrapping SetWindowText (SetConsoleTitle didn't work in my tests). No, it's not needed in Windows 7, because the title command in Windows 7 does not add that extra space that is annoying ...
by jfl
07 Feb 2021 13:08
Forum: DOS Batch Forum
Topic: How to get rid of the extra character ahead of the title
Replies: 11
Views: 2896

Re: How to get rid of the extra character ahead of the title

Excellent, thanks! :D I did not know that such Xterm escape sequences worked in the old console too. This seems something new in Windows 10 though, because a quick test in Windows 7 did not work there. Just curious, why do you set that admintitle variable, and invoke it as a second command afterward...
by jfl
29 Jan 2021 14:58
Forum: DOS Batch Forum
Topic: MODE CON:...
Replies: 2
Views: 1243

Re: MODE CON:...

Could it be that the 'mode con' moves the cursor to the top left corner every time?
by jfl
27 Jan 2021 12:42
Forum: DOS Batch Forum
Topic: How to get rid of the extra character ahead of the title
Replies: 11
Views: 2896

How to get rid of the extra character ahead of the title

As search does not work anymore on the forum (Anybody looking at this?), I'm turning to other peoples' memory... I noticed that the title command inserts an extra space in front of the title string. By default, my cmd console has the title: Administrator: Command Prompt But if I run: title Command P...