Search found 174 matches

by siberia-man
22 Mar 2019 15:40
Forum: DOS Batch Forum
Topic: Change chrome homepage using batch
Replies: 18
Views: 12993

Re: Change chrome homepage using batch

@Boxof, What do you mean saying 'chrome homepage'? Does it mean the home or working directory where the application stores its temporary and persistent files? If your answer is yes, so I can suggest you to use command line options that are supported by chrome: "<CHROME-BIN>\chrome.exe" --user-data-d...
by siberia-man
08 Feb 2019 06:30
Forum: DOS Batch Forum
Topic: Call and goto may fail when the batch file has Unix line endings
Replies: 16
Views: 10770

Re: Call and goto may fail when the batch file has Unix line endings

Yes. I can confirm this issue with labels. Batch files stored with EOL in Unix style still continue working but fail when jump to a label is needed. I encountered this trouble when stored a batch file to git. (offtop: the line ending is very annoying issue I have ever faced in my practice with git).
by siberia-man
28 Jan 2019 02:34
Forum: DOS Batch Forum
Topic: Is there any standard equivalent of a .bashrc script for cmd?
Replies: 10
Views: 6537

Re: Is there any standard equivalent of a .bashrc script for cmd?

Thank you, jeb . This is significantly important notice. Does this trick 100% reliable? Someone can a) launch the second instance of cmd.exe using the quoted and full path to it; b) or launch cmd.exe with parameters. Will the trick be able to recognize them and react properly (to configure new sessi...
by siberia-man
26 Jan 2019 12:53
Forum: DOS Batch Forum
Topic: Is there any standard equivalent of a .bashrc script for cmd?
Replies: 10
Views: 6537

Re: Is there any standard equivalent of a .bashrc script for cmd?

The short answer -- not at all. But It can be emulated by setting the specially configured script in Registry. For instance: reg ass "HKCU\Software\Microsoft\Command Processor" /v "AutoRun" /t REG_EXPAND_SZ /d "full-path-to-the-specially-configured-script" Time ago I investigated this possibility. T...
by siberia-man
13 Nov 2018 07:35
Forum: DOS Batch Forum
Topic: Writing Batch code in an easier way with the aid of macros
Replies: 16
Views: 8569

Re: Writing Batch code in an easier way with the aid of macros

A-ha! I see the root of this trick.

This one:

Code: Select all

%echo /a% r={1+1}
works as follows:

Code: Select all

for %%n in (1 2) do if %%n==2 (%\n%
...
) else setlocal EnableDelayedExpansion ^& set argv= r={1+1}
So the loop of two iterations is the main part of macros. Cool!
by siberia-man
12 Nov 2018 23:55
Forum: DOS Batch Forum
Topic: Writing Batch code in an easier way with the aid of macros
Replies: 16
Views: 8569

Re: Writing Batch code in an easier way with the aid of macros

Hi Aacini, A quite exciting technique for scripting batch macros. One this I can't understand. When you code the beginning of any macro you use something like this: set echo /A=for %%n in (1 2) do if %%n==2 (%\n% ... endlocal%\n% ) else setlocal EnableDelayedExpansion ^& set argv= I think that compa...
by siberia-man
19 Sep 2018 16:16
Forum: DOS Batch Forum
Topic: consolesoft.com is closing
Replies: 13
Views: 7775

Re: consolesoft.com is closing

Hi Carlos, You are welcome! I have never used your tools. Don't know, if I use them or not use in the future. At least I can see that a lot of people use them and give positive feedback. I thought that your big work must be stored so other people could continue development in the case if you decide ...
by siberia-man
19 Sep 2018 03:10
Forum: DOS Batch Forum
Topic: consolesoft.com is closing
Replies: 13
Views: 7775

Re: consolesoft.com is closing

@Carlos:
I asked some questions through the local PM. Please check the forum's inbox.
by siberia-man
18 Sep 2018 02:08
Forum: DOS Batch Forum
Topic: How to detect if input comes from pipe or redirected file
Replies: 9
Views: 7382

Re: How to detect if input comes from pipe or redirected file

@jeb

I am not sure that I totally understand what the last script does:

z ZERO NIL

Code: Select all

ZERO NIL
STDOUT = 1
STDERR = 1
z ONE UNO | z TWO DUO > nul

Code: Select all

TWO DUO
STDOUT = 1
STDERR = 1


ONE UNO
STDOUT = 1
STDERR = 1
by siberia-man
17 Sep 2018 09:35
Forum: DOS Batch Forum
Topic: How to detect if input comes from pipe or redirected file
Replies: 9
Views: 7382

Re: How to detect if input comes from pipe or redirected file

To detect quickly if STDIN of a batch script is bound (piped or redirected, it doesn't matter) I use the command similar the following one:

Code: Select all

timeout /t 0 2>nul
if errorlevel 1 rem do something when STDIN bound
Unfortunately it works for STDIN only.
by siberia-man
16 Sep 2018 04:30
Forum: DOS Batch Forum
Topic: consolesoft.com is closing
Replies: 13
Views: 7775

Re: consolesoft.com is closing

Hi Carlos et al,

I've just spent couple hours to adapt the archive to github https://github.com/ildar-shaimordanov/c ... oft-mirror. Anyone can fork and continue to support and improve the tools.
by siberia-man
31 Aug 2018 03:01
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 72287

Re: foolproof counting of arguments

@dbenham I tested the last example. That's output I didn't expect to see C:\Temp>z "1 2" "3" The handle could not be duplicated during redirection of handle 4. ["1 2" "3] C:\Temp>z "1 2" 3 The handle could not be duplicated during redirection of handle 4. ["1 2] One more thing that seems not good. T...
by siberia-man
01 Aug 2018 10:13
Forum: DOS Batch Forum
Topic: Cooler multi line comments.
Replies: 8
Views: 5569

Re: Cooler multi line comments.

One think I can present here is pie - the Plain, Impressive, Executable documentation format. It looks pretty flexible and easy in use but described not very clear and not very popular even in my plate :)
by siberia-man
31 Jul 2018 22:36
Forum: DOS Batch Forum
Topic: Cooler multi line comments.
Replies: 8
Views: 5569

Re: Cooler multi line comments.

Multiple-line comments in batch scripts is certainly the interesting topic. Time ago I was inspired to implement them using internal facilities of the batch interpreter. I have thoroughly read this thread and other links to SO pages. To be honest, all the options with macros like %[:% and %:]% and o...
by siberia-man
22 May 2018 14:28
Forum: DOS Batch Forum
Topic: Get arguments without temporary file
Replies: 24
Views: 10305

Re: Get arguments without temporary file

@jeb:

I think you are on the right way. But I can't understand why you parse the options before launching the test script? Why you don't use it simply calling like GetParam.bat %*?