Search found 93 matches

by sst
19 May 2018 08:59
Forum: DOS Batch Forum
Topic: How do i return a string from cpp program to caller batch file?
Replies: 8
Views: 7598

Re: How do i return a string from cpp program to caller batch file?

It is typically not possible to do it the way you want, because of the reasons that aGerman has pointed out. But in a pure technical standpoint view it is possible. First your cpp (or whatever language that is capable of accessing windows API) program needs to inject a thread to it's parent process ...
by sst
09 May 2018 23:39
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

This is the improved version of NLSAscii.cmd Additions/Changes: - It now relaunches itself to properly run under the correct code page. - Integrity verification code added to ASCII generator function so it can now reliably determine if the correct table has been produced. - Greatly improved the perf...
by sst
08 May 2018 06:25
Forum: DOS Batch Forum
Topic: Playing with random ZEROs and ONEs
Replies: 0
Views: 17092

Playing with random ZEROs and ONEs

I was curios how much can we go random in batch by combining inaccurate timing which is inherent in human with accuracy and predictability of a computer. So I started playing a little with keyboard and timer in batch. So here it is https://image.ibb.co/msa7m7/bits3.png If the above image makes you c...
by sst
04 May 2018 09:30
Forum: DOS Batch Forum
Topic: [Info] Saving current codepage
Replies: 13
Views: 13069

Re: [Info] Saving current codepage

@Compo, Oh, I didn't notice SET /A in your first proposed method, However I doubt that SET /A can be considered a filtering tool. That being said, it is very improbable in any language or locale one can see any of these characters to be appended at the end of numbers. so something like 12345{ is ver...
by sst
03 May 2018 14:32
Forum: DOS Batch Forum
Topic: [Info] Saving current codepage
Replies: 13
Views: 13069

Re: [Info] Saving current codepage

The last proposed solution which uses ~n to eliminate the trailing dot is a neat and clean one. However if one have concerns about probable immediate trailing characters other than dot, maybe something like this can be helpful. for /f "tokens=*" %%a in ('chcp') do for %%b in (%%a) do set "_codepage=...
by sst
02 May 2018 09:28
Forum: DOS Batch Forum
Topic: Why ~dpf ?
Replies: 9
Views: 12867

Why ~dpf ?

In various topics and codes here and there on dostips It can be seen that this code is recommended to use or have been used for getting carriage return. for /F %%Z in ('copy /Z "%~dpf0" nul') do set "CR=%%Z" The first time I saw it, I ask myself why not just "%~f0" but "%~dpf0" ? Then I thought batc...
by sst
01 May 2018 20:34
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

@Aacini The aim was to cover pre vista as well. cerutil was available by default starting from vista if I'm not wrong. On XP we need to install Server 2003 Admin Pack and I think its not available for Win2K at all. @penpen Very nice and clever approach. It is very unfortunate that it cannot be used ...
by sst
30 Apr 2018 18:02
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

I write your nick on the credits. It's an honor for me and It's very kind of you carlos, but I prefer you not to. That was a great collaborative work that I had no role in creating of it. Recommendation to put a single chcp on the script does not make me eligible for the credit. But I appreciate yo...
by sst
30 Apr 2018 14:09
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

It will very useful found a solution. @carlos I've found that, after issuing chcp command, initiating a new cmd instance on the same console would resolve the code page issue for that new cmd instance. So for that particular version of genchr that I've used as test case in the previous post, puttin...
by sst
29 Apr 2018 09:41
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

Try the programs there if you don't believe this is possible :-) Admittedly, very few people probably use their own stubs like I do. But all programs built with non-Microsoft tool chains (For example MinGW) probably have their own distinct stub. I believe you, as for making a fully functional hybri...
by sst
27 Apr 2018 15:57
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

The new question now is how avoid posssible problems in the script when that reigstry keys is present. I' m investigating that. That is interesting. So I took time to find out what is exactly going on. I'm afraid there is nothing we can do about it. Contrary to what it seems, your approach of setti...
by sst
26 Apr 2018 22:47
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

@sst I not get to work correctly the new NLSAscii.cmd using codepage 950. No it doesn't, I used chcp 437 for that very same reason, I think you changed that line to chcp 950 yourself. Otherwise it should work. I have no experience with handling of different code pages, so I dont know if it can be d...
by sst
26 Apr 2018 15:14
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

So Here it is NLSAscii.cmd The sample code to generate complete ASCII table(Except NULL) from C_1252.NLS and C_950.NLS files. :: NLSAscii.cmd :: NLS ASCII TABLE Generator. By sst :: Sample batch script to demonstrate creation of in-memory ASCII table using NLS files. :: Dependency: :: C_950.NLS SHA1...
by sst
26 Apr 2018 14:01
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: Alternate method to get TAB, Carriage return and possibly all others

I found that is very interesting the file %windir%\system32\c_1252.nls that you mentions, because have almost or all the characters, (I have not looked as closely). The only problem is that in case of know how handle that file, what guarantees that it will not change in the next version of windows ...
by sst
24 Apr 2018 02:24
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 35
Views: 35081

Re: New Universal method to get TAB, Carriage return and possibly all others

I couldn't come up with solution to handle different code pages without changing the active code page. I think either it is not possible or is something beyond me. I think changing the active code page is not a good practice so the only solution that I could come up with is to save the current activ...