Search found 29 matches

by koko
06 Oct 2019 22:08
Forum: DOS Batch Forum
Topic: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)
Replies: 14
Views: 3277

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

Hi, At that time I had simply forgotten an endlocal which I had now inserted. Therefore, the pairs should always be turned on and off exactly. Very interesting. Quite a bit over my head :) Would someone mind explaining in which part the variables could be set for use under enableddelayedexpansion e...
by koko
06 Oct 2019 04:09
Forum: DOS Batch Forum
Topic: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)
Replies: 14
Views: 3277

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

There's still something wrong in you current version. The first argument consists of several paths. Updated both scripts. It now divides the input paths into new lines within the single arguments variable, then wraps each line in double quotes regardless of whether the path has spaces or not. The p...
by koko
05 Oct 2019 17:06
Forum: DOS Batch Forum
Topic: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)
Replies: 14
Views: 3277

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

Interesting! I'll keep that in mind. There's still something wrong in you current version. The first argument consists of several paths. Oops, must have been I tested the double quote pre-wrapping manipulation with a certain selection of those inputs that didn't reveal this mistake (I've also found...
by koko
05 Oct 2019 15:35
Forum: DOS Batch Forum
Topic: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)
Replies: 14
Views: 3277

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

Yes, unfortunately. The problem you are facing is still caused by the ampersand bug. If you drag/drop a file with the name you provided to a script that consists of nothing but @pause , the cmd will still crash. You don't even have any chance to access the cmdcmdline variable. Updated the scripts t...
by koko
05 Oct 2019 07:20
Forum: DOS Batch Forum
Topic: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)
Replies: 14
Views: 3277

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

Updated two lines to differently trim the args variable so it works properly for paths with ampersands and no spaces (a test I forgot to try until I was reminded of it by this topic). Edit: ampersands and alphanumeric by themselves are fine however after testing a path with no spaces with !§$%&()=`´...
by koko
01 Oct 2019 05:26
Forum: DOS Batch Forum
Topic: Thoughts on this alternative method of obtaining cmdcmdline arguments (safe for all characters?)
Replies: 14
Views: 3277

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

Yes, I got these as well when I tried posting a message about my updated version of which.exe last week. Looks like it's working without errors currently, so hopefully it's sorted :) In the meantime realized I hadn't accounted for paths without spaces in the initial 'new method' scripts (which obvi...
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: 3277

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: 3277

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: 1999

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: 1999

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: 2717

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: 1999

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: 2717

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: 1905

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: 2717

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 ...