Search found 120 matches

by siberia-man
19 Apr 2019 04:33
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 28
Views: 328

Re: gzip batch

rename gzip.bat to gz.bat
by siberia-man
18 Apr 2019 02:20
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 28
Views: 328

Re: gzip batch

you do something not in right way. Please try with a single file and check your results.
by siberia-man
17 Apr 2019 06:57
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 28
Views: 328

Re: gzip batch

I don't know and can't imagine what have you done. First of all, try to run the script with a single file check the result and go ahead with others.
by siberia-man
16 Apr 2019 14:10
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 28
Views: 328

Re: gzip batch

geronimo1,

I am so sorry that I have made some rude mistakes. I updated my previous post and fixed them. Please try again.
by siberia-man
16 Apr 2019 06:20
Forum: DOS Batch Forum
Topic: which.exe v1.12 - Now efficiently detecting doskey macros and PS aliases
Replies: 4
Views: 294

Re: which.exe v1.12 - Now efficiently detecting doskey macros and PS aliases

Yet another "batch only" implementation of the "which" utility can be found here: https://github.com/ildar-shaimordanov/cmd.scripts/blob/master/bin/which.bat :: USAGE: :: which [-a] [--] name [...] :: :: -a Print all available matchings accordingly the description below. :: :: For each of the names ...
by siberia-man
16 Apr 2019 02:01
Forum: DOS Batch Forum
Topic: gzip batch
Replies: 28
Views: 328

Re: gzip batch

Very simple

Code: Select all

@echo off

setlocal

set "ext_o=.gz"

if /i "%~x1" == ".css"  set "ext_o=.csz"
if /i "%~x1" == ".js"   set "ext_o=.jgz"
if /i "%~x1" == ".html" set "ext_o=.htz"

gzip -c "%~dpnx1" > "%~dpn1%ext_o%"
by siberia-man
22 Mar 2019 15:40
Forum: DOS Batch Forum
Topic: Change chrome homepage using batch
Replies: 18
Views: 694

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

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

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

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

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

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

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

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

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