Search found 470 matches

by Liviu
22 Jan 2012 12:27
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 105003

foolproof counting of arguments

Is there a way to reliably get the count of arguments a batch file was called with, safe against odd inputs, and preferably without invoking external programs or temp files? Some test cases which fail most naive counting approaches would be... ⋅ " --- expected count 1 ⋅ &quo...
by Liviu
20 Jan 2012 15:31
Forum: DOS Batch Forum
Topic: Piped input and output to a batch file
Replies: 18
Views: 22061

Re: Piped input and output to a batch file

My PIPE.COM program is only 69 bytes in size, so it is a very good replacement of FINDSTR to be used in these cases. If you are worried about where to get my program from, here it is; just copy the 69 bytes below to a file named PIPE.COM and it is ready to run: ë2´)€ì!Í!ŠÐŠà€Ä!€ü.u.€þ+u)R²A€ê!´#€ì!...
by Liviu
14 Jan 2012 15:12
Forum: DOS Batch Forum
Topic: Displayed case of drive letter can vary
Replies: 2
Views: 3758

Re: Displayed case of drive letter can vary

dbenham wrote:I ran this in Vista.
Has it always been like this :?: Are there any versions that act differently :?:

Confirmed in Vista x64 (biz) and Win 7 x86 (pro), both at the regular and elevated cmd prompts.

XP (pro) has it always uppercase, though. Funny, indeed.

Liviu
by Liviu
13 Jan 2012 23:50
Forum: DOS Batch Forum
Topic: How to replace "=","*", ":" in a variable
Replies: 34
Views: 289352

Re: How to replace "=","*", ":" in a variable

In other words, the test checks if a variable contains =. It is not designed to test if a command argument contains =. The test can't begin until we have a value in the variable. Thanks for clarifying, though the way it was posted it sure looked like it was meant to test the command argument being ...
by Liviu
13 Jan 2012 21:36
Forum: DOS Batch Forum
Topic: How to replace "=","*", ":" in a variable
Replies: 34
Views: 289352

Re: How to replace "=","*", ":" in a variable

I don't have a good solution for replacing =, but I do have a quick test to see if a value contains = . This test may return false positives if the value contains '!' exclamation marks. For example, create a directory "C:\x=y" and make it current, so that "%cd%" is "C:\x=y&...