Search found 38 matches

by koko
29 Sep 2019 11:13
Forum: DOS Batch Forum
Topic: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)
Replies: 14
Views: 23095

Re: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)

Getting 500 server error messages each time I either edit or submit a post. Anyone else getting these? Tried to edit the OP twice subsequent to the first edit and it failed. Edit: perhaps in part due to some post character limit (though I also get server errors editing posts in general as well). Cop...
by koko
29 Sep 2019 11:05
Forum: DOS Batch Forum
Topic: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)
Replies: 14
Views: 23095

Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)

After reaching a maximum setlocal recursion level in one of my scripts due to going over a certain number of inputs I decided to re-face the abyss that is batch escaping and getting past endlocal barriers to see if I could find or come up with some alternative method that fulfilled the following aim...
by koko
22 Sep 2019 03:07
Forum: DOS Batch Forum
Topic: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?
Replies: 4
Views: 9588

Re: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?

Do you know for sure, that the Blacklist is shorter? How many characters are in that list? It should be possible, but the method highly depends on the characters and their amount in that blacklist. Just so I understand we're referring to the same thing, did you mean 'do you know for sure that the b...
by koko
21 Sep 2019 19:46
Forum: DOS Batch Forum
Topic: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?
Replies: 4
Views: 9588

Re: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?

Just realized I could bypass the output naming directly by the program and instead name it something safe temporarily before using ren to rename the output afterward to the proper string with all characters intact. Obvious in hindsight. Though if there was such a method as described in the OP I'd ce...
by koko
21 Sep 2019 19:29
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 16302

Re: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appeara

I'm not sure what you mean there... . In case you want the order in a simpler format, where you have to change only one index per entry in your example, then you might encapsulate that in an array, too That would make it simpler to change the order for the original hard-numbered array concept, true...
by koko
21 Sep 2019 02:51
Forum: DOS Batch Forum
Topic: Method of 'whitelisting' various characters then replacing any characters in strings that don't match?
Replies: 4
Views: 9588

Method of 'whitelisting' various characters then replacing any characters in strings that don't match?

From what I can tell a program I'm sending files to has trouble processing certain Unicode characters in filenames (not special characters or even things like umlauts but for eg alternate Unicode solidus characters). Ideally I thought it would be useful if a whitelist of characters could be defined ...
by koko
19 Sep 2019 20:02
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 16302

Re: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appeara

You may achieve the same result in simpler ways. For example Interesting alternative, will keep it in mind. (Forum also seemed to be down for a number of hours, hope everything is alright). Edit Also updated below my earlier script example to be more resilient to special characters in the batch fil...
by koko
18 Sep 2019 17:27
Forum: DOS Batch Forum
Topic: [Resolved] Alternative xcopy function to Choice - Carriage return as accepted character possible?
Replies: 3
Views: 8433

Re: Alternative xcopy function to Choice - Carriage return as accepted character possible?

Basically you can. The subroutine contains the line if defined c ( which checks if you pressed Enter without any other input before (which is the case if c is not defined at this position). You can't define it in the map variable though. And of course it needs a separate handling. You might also wa...
by koko
18 Sep 2019 17:22
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 16302

Re: For loop to do something with all variables beginning/prefixed with a string

No. There is no way to control the order in that SET command lists the defined variables; that is the reason because it is convenient to define different arrays with numerical indices... I suggest you to review this topic ... Antonio The thing is, this will be used for some simple user settings so ...
by koko
18 Sep 2019 03:35
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 16302

Re: For loop to do something with all variables beginning/prefixed with a string

in this particular case the variable positions can be re-arranged arbitrarily so the numbering of the variables is probably less useful unless one controls the order. Hmm, turns out after adding more to test with that the variables are being ordered alphabetically during my for loop. Is there actua...
by koko
18 Sep 2019 00:44
Forum: DOS Batch Forum
Topic: [Resolved] Alternative xcopy function to Choice - Carriage return as accepted character possible?
Replies: 3
Views: 8433

[Resolved] Alternative xcopy function to Choice - Carriage return as accepted character possible?

I came across this superb script by by aGerman which is a functional replacement to the choice command using xcopy behind the scenes, executing the conditional errorlevel commands only if the character input matches a predefined list (like choice /n ). Was ideal as I was looking for something that d...
by koko
17 Sep 2019 22:41
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 16302

Re: For loop to do something with all variables beginning/prefixed with a string

You missed a pair of ' characters Ah, thank you. Tried double quotes but that became the literal string, didn't try single quotes. You could do that, but i prefer using variable names that mimic a c/c++/jave-like arrays and direct member selection operator (a dot) You should use something that you ...
by koko
17 Sep 2019 18:40
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 16302

[Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]

I'm guessing this is relatively straightforward but my attempts have obviously been missing the mark. I have several variables beginning with a fixed string that change in quantity (ie: an unknown number of them) and I'm trying to set up a for loop that does something for each one beginning from the...
by koko
15 Aug 2019 22:13
Forum: DOS Batch Forum
Topic: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?
Replies: 6
Views: 13614

Re: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?

Nope. Certutil will always write the encoded content to a file. Furthermore URIs don't have newlines and the string length in Batch is restricted. Eventually you need at least two temporary files. Also, the -encodehex verb has options that allow you to create base64 using different formats. See htt...
by koko
13 Aug 2019 04:19
Forum: DOS Batch Forum
Topic: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?
Replies: 6
Views: 13614

Send certutil output directly to a variable instead of file, and then finally copy to clipboard?

I've been considering creating a dataURI batch script to make inserting data of files (probably exclusively images) more easily into text editors for web purposes. I discovered that certutil offers the function to base64 encode a file , which is the first step (btw it seems the findstr command in th...