Search found 174 matches

by siberia-man
05 Mar 2020 04:36
Forum: DOS Batch Forum
Topic: psubst: attempt to make virtual drives persistently
Replies: 0
Views: 7994

psubst: attempt to make virtual drives persistently

DESCRIPTION Times ago I invented the tool PSUBST being the extended version for the standard SUBST . Both tools allow to associate some paths with virtual drives. So executing the following command we have ability to achieve the particular path in two ways by the path itself and/or by the drive: su...
by siberia-man
05 Mar 2020 02:38
Forum: DOS Batch Forum
Topic: mshta command for copy into clipboard
Replies: 10
Views: 7080

Re: mshta command for copy into clipboard

Functionality of clipboardData and its method setData is strongly restricted by MSIE. Indeed, try using clip.
by siberia-man
02 Mar 2020 12:57
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 13
Views: 9059

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

I see your point. I need to step back and try to explain everything clearly as much as possible. I'll come back with the updated version of the tool in the first post.
by siberia-man
02 Mar 2020 07:53
Forum: DOS Batch Forum
Topic: mshta command for copy into clipboard
Replies: 10
Views: 7080

Re: mshta command for copy into clipboard

For long time (I don't know exactly since when) Windows is already shipped with the "clip" tool: C:\>clip /? CLIP Description: Redirects output of command line tools to the Windows clipboard. This text output can then be pasted into other programs. Parameter List: /? Displays this help message. Exam...
by siberia-man
02 Mar 2020 02:41
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 13
Views: 9059

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

As you can find -- everything is optional. If you enter an one line program, everything after is assumed as a file for processing. Each argument is opened as a file and processed line by line until EOF. wsx /n /e:"..." file1 file2 ... Otherwise. If you don't enter one line programs, the first item o...
by siberia-man
29 Feb 2020 19:39
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 13
Views: 9059

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

to have a switch for the input and output Not agree. Additional switches make usage more complicated. But this is not fully your issue -- I think it is on my side in majority of cases because I can't immediately give complete and/or comprehensive explanation. In my vision the good tool is a pipe co...
by siberia-man
29 Feb 2020 18:26
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 13
Views: 9059

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

No problem. Asking question is OK. They help to improve description. Let me know about the issues you experienced, if they have occurred.
by siberia-man
29 Feb 2020 06:28
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 13
Views: 9059

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

The first post was updated with separating on the sections and adding more descriptions.
by siberia-man
29 Feb 2020 05:40
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 13
Views: 9059

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

It works in the same manner as other CLI tools. It can read both STDIN and files. If no file is specified, STDIN is assumed as the input. So you can use it as follows:

reading from a pipe

Code: Select all

do something | wsx /n /e:...
reading from a file or file(s)

Code: Select all

wsx /n /e:... FILE
by siberia-man
28 Feb 2020 18:19
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 13
Views: 9059

wsx.bat: REPL, one line program processor supporting some NodeJS features

PREAMBLE Now I decided to publish this script here. Dozen years ago I realized JSCmd.wsf , then extended it and renamed to wscmd.bat (the bat+js hybrid). The curent project called wsx.bat is their successor. Their main goal is to enable REPL and support some useful features like require(...) and co...
by siberia-man
27 Feb 2020 03:31
Forum: DOS Batch Forum
Topic: [SOLVED] Using GNU grep in a Windows batch script?
Replies: 9
Views: 7244

Re: Using GNU grep in a Windows batch script?

print the lines starting with #

as sed:

Code: Select all

sed -n "/^#/p" FILENAME
as grep:

Code: Select all

grep "^#" FILENAME
by siberia-man
08 Feb 2020 23:10
Forum: DOS Batch Forum
Topic: SUDO for CMD
Replies: 9
Views: 12330

Re: SUDO for CMD

Thank you for your comment. Indeed I used CD instead PUSHD to avoid possible POPD in the shell. And I forgot that CD works within a drive by default. I fixed my mistake in all my examples in this thread.
by siberia-man
07 Feb 2020 11:47
Forum: DOS Batch Forum
Topic: SUDO for CMD
Replies: 9
Views: 12330

Re: SUDO for CMD

Are you experiencing any? No. I asked because I remember Windows have a lot of uncertain restrictions. After migrating from WIN7 to WIN10 I encountered trouble with executing mklink /d which was permitted under WIN7 and is not permitted under WIN10. I started to look for solution how to elevate pri...
by siberia-man
07 Feb 2020 01:59
Forum: DOS Batch Forum
Topic: SUDO for CMD
Replies: 9
Views: 12330

Re: SUDO for CMD

Very interesting solution. I have just two questions 1. Could there be the restrictions on modifying the registry? 2. I found how to simplify this solution. It works on my PC. Will it work on others? @echo off :: Create dummy script type nul >"%TEMP%\%~n0.elevate" :: File association: Run .elevate a...
by siberia-man
22 Jan 2020 00:10
Forum: DOS Batch Forum
Topic: Explain batch script - need some help
Replies: 2
Views: 2391

Re: Explain batch script - need some help

I slightly reformated the code from the OP. Just to make it more readable. FOR /f "TOKEN=5" %%i IN ( ' NETSH INTERFACE IPv4 SHOW ROUTE ^| FIND "0.0.0.0/0" ' ) DO @FOR /f "TOKEN=2" %%i IN ( ' NETSH INTERFACE IPv4 SHOW ADDRESSES %%i ^| FIND "IP-Adresse" ') DO @ECHO IPv4 : %%i >> %Ausgabe% Finally this...