Search found 470 matches

by Liviu
07 Feb 2012 11:21
Forum: DOS Batch Forum
Topic: setting variable to value from utf-encoded file
Replies: 3
Views: 5248

Re: setting variable to value from utf-encoded file

You can get any content (without the <NUL> character) from a file with a FOR/F loop or the SET/p technic Thanks, Jeb, but I don't think either works when the file is UTF-8 or UTF-16, which is the difficult point here. Since my phrasing of the question was a bit elliptic, here it is in more detail.....
by Liviu
06 Feb 2012 21:18
Forum: DOS Batch Forum
Topic: setting variable to value from utf-encoded file
Replies: 3
Views: 5248

setting variable to value from utf-encoded file

I've looked up prior art on this topic but haven't found much, except hints that it's not possible. Just thought I'd ask in case I missed something somewhere... For a quick recap, cmd input is fully unicode, and both 'set' and 'set /p' will take a unicode string and assign it correctly, regardless o...
by Liviu
03 Feb 2012 20:14
Forum: DOS Batch Forum
Topic: Software development and regional testing.
Replies: 3
Views: 2274

Re: Software development and regional testing.

In addition to aGerman's good advice... 'Now I want to do regional testing, I want to see how it behaves like in US, germany, france etc.. It depends a lot on the type of project and implementation language. Up to some point you can get by with just toying with your own Windows' regional settings. T...
by Liviu
03 Feb 2012 19:30
Forum: DOS Batch Forum
Topic: Is there a way to create a SUB without using a temp file ?
Replies: 25
Views: 18128

Re: Is there a way to create a SUB without using a temp file

I wonder if it could be useful ... On a tangent, I wonder if the following would be considered fair game for a Quine attempt... @setlocal=enableExtensions,enableDelayedExpansion&set/pq=<"%~f0"&echo(!q! Even shorter if "cmd /e:on /v:on" is assumed, of course. set ^"\...
by Liviu
31 Jan 2012 11:47
Forum: DOS Batch Forum
Topic: Is there a way to create a SUB without using a temp file ?
Replies: 25
Views: 18128

Re: Is there a way to create a SUB without using a temp file

You are using XP sp3 yes? I can confirm XP Home Edition sp3, as well as Vista Home Premium sp2 64bit, and Vista 32 bit (not sure about specifics) How about you aGerman? (or anyone else) Anyone have Windows 7 covered? Yes, xp sp3, and also verified it to work in win7 pro x64. FWIW I'd be surprised i...
by Liviu
30 Jan 2012 21:35
Forum: DOS Batch Forum
Topic: Making Force Close Batch
Replies: 10
Views: 3571

Re: Making Force Close Batch

It was taken offensively...thanks for your help when someone is trying to start learning something new.... A fair forewarning is often helpful as well, and that's all I meant to say. Once you delve deeper into the internals, processes, shared memory, global objects, files, pipes, transactions etc. ...
by Liviu
30 Jan 2012 21:23
Forum: DOS Batch Forum
Topic: Is there a way to create a SUB without using a temp file ?
Replies: 25
Views: 18128

Re: Is there a way to create a SUB without using a temp file

However, it causes crazy effects in a batch code I wonder if it could be useful ... Very useful indeed Now we can embed VBScript in a batch file without resorting to a temporary file. ... We can even make the batch portion complex if we are willing to put up with the nasty ::' prefix. Batch labels...
by Liviu
30 Jan 2012 21:02
Forum: DOS Batch Forum
Topic: Making Force Close Batch
Replies: 10
Views: 3571

Re: Making Force Close Batch

Hey guys, making a batch to force any processes I chose to close...I have it running fine...just a simple code.... ... But, I was wondering if any of you can help me...I was interested in seeing if you can make code that will display a list of all the current processes...thanks in advance! You guys...
by Liviu
30 Jan 2012 17:58
Forum: DOS Batch Forum
Topic: Is there a way to create a SUB without using a temp file ?
Replies: 25
Views: 18128

Re: Is there a way to create a SUB without using a temp file

echo( echo expanded%sub%echo fails echo( expanded→echo fails Think you meant "expanded%sub%echo works ". And, thanks for the rest of the test cases. About the "doesn't play nicely with FOR /F" don't know that I have strong enough expectations about what "nicely" is in ...
by Liviu
30 Jan 2012 17:46
Forum: DOS Batch Forum
Topic: unexpected jump
Replies: 8
Views: 2839

Re: unexpected jump

And, in all cases, replacing "exit /b" with just "exit" will close the original part1 console itself. Nothing unusual there. That is how EXIT always works, hence the need for the /B option. Right, of course. Yet "always" is relative to the charted territories. The beha...
by Liviu
30 Jan 2012 14:05
Forum: DOS Batch Forum
Topic: Is there a way to create a SUB without using a temp file ?
Replies: 25
Views: 18128

Re: Is there a way to create a SUB without using a temp file

The (cmd) world would be a better more predictable place, had you never asked that question :: → @echo *** WHAT ??? @set /p "SUB=" <"%~f0" @set "SUB=%SUB:~3,1%" @echo this %SUB% works *** WHAT ??? this → works Note that the "→" on the top line must be the sing...
by Liviu
29 Jan 2012 21:13
Forum: DOS Batch Forum
Topic: unexpected jump
Replies: 8
Views: 2839

Re: unexpected jump

Btw. I suppose this is a goto not a call, as in %0 is the name of the batch file, not the name of the function Right. However, it seems to be very "syntactically sensitive". If, in part1, you replace the " part2 argFromPart1 " line with " if 0==0 part2 argFromPart1 " t...
by Liviu
29 Jan 2012 01:27
Forum: DOS Batch Forum
Topic: unexpected jump
Replies: 8
Views: 2839

Re: unexpected jump

But I can't imagine how bad the code must be in cmd.exe that this can occour. I was wondering the same... My imagination cannot fathom a scenario where this could be the side effect of even the weirdest implementation bug. Alternative theory might then be that it's a "hidden feature" for ...
by Liviu
27 Jan 2012 12:55
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 43250

Re: foolproof counting of arguments

Good idea, but it fails too ... As now your code would fail with foolProofParam.bat %a...%~a...%~dpa Thanks for pointing that. Think I have a workaround, see the "2nd EDIT" comments above. What we need is a character that can be defined as a FOR variable, but can't be expanded. I've never...
by Liviu
26 Jan 2012 16:35
Forum: DOS Batch Forum
Topic: unexpected jump
Replies: 8
Views: 2839

Re: unexpected jump

Both exec and exec-fail are "broken" For different values of "broken", though Your example verifies that the :indirect call (my :exec) does indeed work in the sense that I meant in the original post - execute an external program without an explicit "call" or "cmd ...