Search found 93 matches
- 13 Sep 2019 18:24
- Forum: DOS Batch Forum
- Topic: Closing parenthesis prevents escape of subsequent special character operator
- Replies: 33
- Views: 36273
Re: Closing parenthesis prevents escape of subsequent special character operator
I mean... what is unclear to me is, that i don't get why MS seems to have built a parser, that behaves differently depending on the command token, when splitting the command and argument string: If the expected output of "REM One^\r\n Two^ Three^\r\n This is the comment\r\n" is the (command, argume...
- 08 Sep 2019 05:28
- Forum: DOS Batch Forum
- Topic: Closing parenthesis prevents escape of subsequent special character operator
- Replies: 33
- Views: 36273
Re: Closing parenthesis prevents escape of subsequent special character operator
Now, I understand why the REM trick to gather the arguments works so good, and why it fails with multiline input. The REM parser will read the first token(GeToken) and compares it against "/?". If the token is "/?" it sets the help flag to true else it ungets the token(UnGeToken) and do a second Ge...
- 06 Sep 2019 08:15
- Forum: DOS Batch Forum
- Topic: Closing parenthesis prevents escape of subsequent special character operator
- Replies: 33
- Views: 36273
Re: Closing parenthesis prevents escape of subsequent special character operator
I stumbled upon this old post of mine, and I just realized the last behavior is identical to REM :shock: :!: If there is only one following token ending with escape and end of line, then the token is thrown away. This repeats until there is more than one token on the line, or the line doesn't end w...
- 06 Sep 2019 00:02
- Forum: DOS Batch Forum
- Topic: Closing parenthesis prevents escape of subsequent special character operator
- Replies: 33
- Views: 36273
Re: Closing parenthesis prevents escape of subsequent special character operator
It's interesting, that this list doesn't contain the escape operator (the circumflex accent character: '^'). That raises the question, if you used something like IDA, where you see all code, or if you just traced the program flow. The first option would be nice, beacause then it could be possible t...
- 02 Sep 2019 08:10
- Forum: DOS Batch Forum
- Topic: Closing parenthesis prevents escape of subsequent special character operator
- Replies: 33
- Views: 36273
Re: Closing parenthesis prevents escape of subsequent special character operator
I am not able to escape a special character operator token if it appears immediately after a closing parenthesis. Not sure how this is useful, but I find it interesting. I would expect the escaped forms to generate a syntax error, but rather the "escaped" operator is fully functional :!: Anyone hav...
- 18 Aug 2019 01:02
- Forum: DOS Batch Forum
- Topic: Newly discovered pipe behavior - and a fun challenge!
- Replies: 5
- Views: 8749
Re: Newly discovered pipe behavior - and a fun challenge!
But my jaw dropped when I saw the results of 9, 10, and 11. The output for test 11 is 907 bytes :!: :shock: I have yet to take the time to trace the logic of the last three tests. I probably miss something... but i don't see anything else but expected recursive environment variable expansion?! Yes ...
- 16 Aug 2019 00:07
- Forum: DOS Batch Forum
- Topic: Newly discovered pipe behavior - and a fun challenge!
- Replies: 5
- Views: 8749
Re: Newly discovered pipe behavior - and a fun challenge!
I explained this before to describe the inner workings of pipe creation in CMD. (In the graph that demonstrates the difference between the parenthesized and naked external processes in the pipes) This behavior is the main reason that the technique for accessing the pipe by the parent CMD is working ...
- 25 Jan 2019 14:11
- Forum: DOS Batch Forum
- Topic: doskey output can't always be captured
- Replies: 3
- Views: 5364
Re: doskey output can't always be captured
The behavior may seem strange, but it' not strange at all Completely unrelated to my other recent posts, I noticed something very strange with doskey today: I occasionally search commands in the command history by typing something like: doskey /history | findstring SOMEPROGRAM As I'm lazy, to have l...
- 31 Dec 2018 01:44
- Forum: DOS Batch Forum
- Topic: Directly reading from pipe by the parent CMD process
- Replies: 19
- Views: 19548
Re: Directly reading from pipe by the parent CMD process
Hi Dave, Thanks for your feedback. Well I can't deny the fact that my write up is far from perfect, so, at least it could be one of the reasons behind your confusion. As it is obvious, English is not my native language. That's not an excuse, but anyway, It's not an easy task for me to write in Engli...
- 23 Dec 2018 08:38
- Forum: DOS Batch Forum
- Topic: Advice Question - how to check to see if file has already been ran?
- Replies: 3
- Views: 4092
Re: Advice Question - how to check to see if file has already been ran?
If you can consider changing the design of your script then something like this should do the job for %%A in ("%FDMEE_BIN%\*") do call :RUNLOAD "%%~A" But if you want to stick with your current design then you can try this less efficient method REM Initialization dir /a-d /b "%FDMEE_BIN%\" >"%TEMP%\...
- 22 Dec 2018 06:00
- Forum: DOS Batch Forum
- Topic: Directly reading from pipe by the parent CMD process
- Replies: 19
- Views: 19548
Re: Directly reading from pipe by the parent CMD process
This is the script that demonstrates all three kinds of pipe stealing by reading from pipe, writing to, or writing to and reading from pipe from the same process (self pipe) within CMD/batch scripts. This script is just intended to demonstrate the concept, not to promote using the techniques in prod...
- 22 Dec 2018 04:24
- Forum: DOS Batch Forum
- Topic: Directly reading from pipe by the parent CMD process
- Replies: 19
- Views: 19548
Re: Directly reading from pipe by the parent CMD process
I know there are differences, but you got the outcomes incorrect. Yes you are correct that was my mistake. I know echo !str! | break works (assuming delayed expansion was enabled before of course). I was intended to use (echo !str! )| break , and my description was not precise for why it is not wor...
- 21 Dec 2018 19:37
- Forum: DOS Batch Forum
- Topic: Directly reading from pipe by the parent CMD process
- Replies: 19
- Views: 19548
Re: Directly reading from pipe by the parent CMD process
PipeBlocking.bat 4095 --- Works without blocking PipeBlocking.bat 4096 --- Blocks Hi Jeb, Except one thing: you forgot that an extra space follows by echo %%testStr%% which will be inserted by parser. You have to remove one more char from the testStr set "testStr=!testStr:~0,-3!" , PipeBlocking.bat...
- 16 Dec 2018 00:37
- Forum: DOS Batch Forum
- Topic: Directly reading from pipe by the parent CMD process
- Replies: 19
- Views: 19548
Directly reading from pipe by the parent CMD process
I've found a way to directly reading from pipe by the parent CMD process that initiated the pipe connection between two child processes. So it is possible to directly store a command/program output in a variable without using FOR /F It has it's own limitations and may not be suitable for every day u...
- 24 Sep 2018 00:06
- Forum: DOS Batch Forum
- Topic: copy partition script
- Replies: 3
- Views: 4725
Re: copy partition script
Try HDClone https://www.miray.de/products/sat.hdclone.html
It supports automation through its CLI. But I'm not sure if the free version has all the capabilities you need.
It supports automation through its CLI. But I'm not sure if the free version has all the capabilities you need.