Search found 470 matches

by Liviu
14 May 2014 21:09
Forum: DOS Batch Forum
Topic: [Updated] Patch for cmd.exe for windows xp for cp 65001
Replies: 29
Views: 11035

Re: Patch for cmd.exe for windows xp for cp 65001

After this patch cmd.exe for windows x86 would use the same behavior on MultibyteToWideChar that cmd.exe for windows 7. This means that codepage 65001 is fully supported. I'd qualify that to " supported at the same level as Win7 " - which is not "fully". Pipes are still broken, ...
by Liviu
14 May 2014 20:47
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 38
Views: 85110

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

Sponge Belly wrote:But why doesn’t…

Code: Select all

(call;>>file.txt)
clobber the SUB at the end of file.txt?

Because 'call;' outputs nothing at all. You can check the timestamps of 'file.txt' to see that it wasn't modified. The SUB is only clobbered if there is something actually being appended to the file.

Liviu
by Liviu
14 May 2014 00:27
Forum: DOS Batch Forum
Topic: Attempt to catch arrow keystrokes
Replies: 21
Views: 8023

Re: Attempt to catch arrow keystrokes

Wouldn't it be awesome to work with arrow keys in a Batch file? Good question. Problem is that most command line utilities work at the "standard streams" interfaces, and rightfully so since that's what allows the usual redirection and piping. However, the standard streams are character ba...
by Liviu
11 May 2014 20:43
Forum: DOS Batch Forum
Topic: [Updated] Patch for cmd.exe for windows xp for cp 65001
Replies: 29
Views: 11035

Re: Patch for cmd.exe for windows xp for cp 65001

For UTF-8 ..., dwFlags must be set to either 0 .... Otherwise, the function fails with ERROR_INVALID_FLAGS. Right, and also for a few other codepages listed at http://msdn.microsoft.com/en-us/library/windows/desktop/dd319072(v=vs.85).aspx . That's what makes your patch work for codepage 65001. Howe...
by Liviu
11 May 2014 19:31
Forum: DOS Batch Forum
Topic: [Updated] Patch for cmd.exe for windows xp for cp 65001
Replies: 29
Views: 11035

Re: Patch for cmd.exe for windows xp for cp 65001

Because cmd.exe for windows xp cannot run a batch script when it use the codepage 65001 (utf-8), I investigate the cause, and I found. Also, I created a patch for it. That's quite a feat. Cmd2 seems to run batch tasks under codepage 65001, which xp couldn't. Don't know how applicable it's going to ...
by Liviu
10 May 2014 21:22
Forum: DOS Batch Forum
Topic: REPLVAR.BAT - regex search and replace for variables
Replies: 32
Views: 12116

Re: REPLVAR.BAT - regex search and replace for variables

using raster font and codepage 65001, when I run 65001.bat I get this message on windows 7 japanase: the system cannot write to the specified device Using a raster font, you'll get the exact same error on an English Windows while trying to display "‹αß©∂€›" under chcp 437 for example. Tha...
by Liviu
10 May 2014 19:28
Forum: DOS Batch Forum
Topic: REPLVAR.BAT - regex search and replace for variables
Replies: 32
Views: 12116

Re: REPLVAR.BAT - regex search and replace for variables

If I run the 65001.cmd using the codepage 65001 (for comodity windows 7 that run batch files using codepage 65001 ...) it not save the variable correctly, it corrupt it 65001.cmd works correctly for me in win7x64.sp1 when run under chcp 65001 at a cmd prompt using a Unicode font (note: it does not ...
by Liviu
10 May 2014 17:33
Forum: DOS Batch Forum
Topic: REPLVAR.BAT - regex search and replace for variables
Replies: 32
Views: 12116

Re: REPLVAR.BAT - regex search and replace for variables

I tested it in a windows 7 japanase, and the same corruption behavior happen. Maybe is impossible run a utf8 encoded batch, using codepage 65001. I tried on windows xp and windows 7, both japanase, and none works ok. And, also windows 7 japanase using raster font cannot display a variable that as i...
by Liviu
09 May 2014 21:29
Forum: DOS Batch Forum
Topic: Comments without increasing macro size
Replies: 31
Views: 10871

Re: Comments without increasing macro size

I tested if there is any difference between a multiline caret and a "natural" linefeed or a linefeed from a percent expansion. I never saw a difference until now I thought for a moment that the difference could be in the hidden CRs. A "natural" linefeed is actually a CR+LF on di...
by Liviu
08 May 2014 18:38
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 38
Views: 85110

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

no label (comment) is needed, but another caret (at least under win 7 home 64 bit) Confirmed under xp.sp3 as well. @echo off ^ echo this line is ignored echo this line is executed ( ^ ^ echo this line is ignored echo this line is executed ) Turns out if the last character in a file is SUB (Ctrl-Z) ...
by Liviu
08 May 2014 11:13
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 38
Views: 85110

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

penpen wrote:Reminds me to the macro comments, but without the "<nul" part.

Very interesting. Also reminds me of other label parsing craziness sighted at http://www.dostips.com/forum/viewtopic.php?f=3&t=3803.

Liviu
by Liviu
08 May 2014 11:06
Forum: DOS Batch Forum
Topic: Quotes when starting a batch file
Replies: 9
Views: 6290

Re: Quotes when starting a batch file

Enclosing quotes without the extension seems to be a special case. Indeed. And that special case breaks self-referential batch code that relies on "%~f0" at the top level, such as: - for/f rereading in order to display embedded help; - relaunching "%~f0" in recursive or hybrid s...
by Liviu
04 May 2014 01:50
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 58
Views: 119379

Re: js/vbs/html/hta hybrids and chimeras in cmd/bat

It has come up before that the "<!-- ::" syntax (or "<!-- :") could be used to build hybrid cmd+xml files. There have been examples of it for cmd+html/mshta/wsf, but I don't recall a cmd+xslt one. This post seeks to cover that missing part. Anyone not interested in xml/xslt might...
by Liviu
04 May 2014 00:31
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 58
Views: 119379

Re: js/vbs/html/hta hybrids and chimeras in cmd/bat

I didn't meant this from the ".WSF" parsers view. I meant this from a XML parsers view Good point, thanks for making it. WSH (cscript/wscript) seems to use its own internal XML parser for WSF files, other than and different from the MSXML or XMLLITE builtins. The WSF handling of CDATA is ...
by Liviu
29 Apr 2014 21:50
Forum: DOS Batch Forum
Topic: How to get available hard drive space [SOLVED]
Replies: 15
Views: 8556

Re: How to get available hard drive space

I can see that the issue has been resolved to everybody's satisfaction, but still have a side comment on this. TBH I see no real reason for accuracy when using integer math which rounds down While it's true that the builtin integer division truncates (rounds down), it's also easy to use it to "...