Search found 165 matches

by siberia-man
23 Sep 2020 10:32
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 60
Views: 143853

Re: js/vbs/html/hta and more hybrids and chimeras in cmd/bat

The latest to this moment version of the script. What has been done -- some cosmetic changes -- improve slightly the argument processing -- add hybridization for AutoIt, AutoHotKey and PHP -- improve creation of the PowerShell chimera The full list of supported languages and technologies -- JavaScri...
by siberia-man
14 Sep 2020 08:46
Forum: DOS Batch Forum
Topic: SUDO for CMD
Replies: 9
Views: 9075

Re: SUDO for CMD

a way to redirect stdin/stdout/stderr from the elevated shell, back into the original shell
It looks like it is solved in gsudo. Sorry, it's C#, not a pure batch.
by siberia-man
08 Sep 2020 10:33
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 13
Views: 5701

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

Version is 1.0.1 (still Alpha). I updated the first post in the topic. Most of changes are cosmetic and some of them slightly improve description.
by siberia-man
05 Sep 2020 07:22
Forum: DOS Batch Forum
Topic: Batch array scripts, to make life easier
Replies: 6
Views: 613

Re: Batch array scripts, to make life easier

A total absence of arrays in batches allows to implement them in different ways: -- arr[idx] (or something similar to) -- arr sep idx (like arr.idx or arr_idx etc) I think that the actual implementation of batch arrays lies on authors of the scripts they develop. In the other hand, if they need arra...
by siberia-man
31 Aug 2020 13:48
Forum: DOS Batch Forum
Topic: g.bat to jump between folders - need help to make it pure batch!
Replies: 16
Views: 3105

Re: g.bat to jump between folders - need help to make it pure batch!

I started review the code deeper and found some places for improvement. Later I found that better to rewrite it from the scratch. Perhaps i will try to do it (partially). From my perspective, there are few possible ways for evolution: 1. avoid \ with / replacement - in this case awk/find/findstr usa...
by siberia-man
30 Aug 2020 16:56
Forum: DOS Batch Forum
Topic: g.bat to jump between folders - need help to make it pure batch!
Replies: 16
Views: 3105

Re: g.bat to jump between folders - need help to make it pure batch!

As far as I understand correctly, the original g.bat script rotates over all folders matching a particular pattern. For example, if we have some folders: another/path/to/ mydir one/another/path/to/ my one/more/ my /dir the script invoked as below g.bat my will do CD to the first and second one (high...
by siberia-man
11 Aug 2020 06:33
Forum: DOS Batch Forum
Topic: [SOLVED] How to get filename from URL and set it to variable?
Replies: 3
Views: 520

Re: How to get filename from URL and set it to variable?

replace

Code: Select all

for /f %%i in ('echo %1 | sed "s/.*\///"') do set FILENAME=%%i
with

Code: Select all

for /f %%i in ('echo %1 ^| sed "s/.*\///"') do set FILENAME=%%i
by siberia-man
08 Aug 2020 01:14
Forum: DOS Batch Forum
Topic: Run Here tool
Replies: 4
Views: 666

Re: Run Here tool

Couple of changes:
-- taboo for "\" in the menu text
-- some cosmetic changes
by siberia-man
07 Aug 2020 04:05
Forum: DOS Batch Forum
Topic: Run Here tool
Replies: 4
Views: 666

Re: Run Here tool

except for a small annoyance: It starts cmd.exe in the parent directory Some additional arguments are required run-here /I "Command Here" /K C:\Windows\System32\cmd.exe C:\Windows\System32\cmd.exe /k cd /d "%V" In addition... If someone would like to set up PowerShell in the same way: run-here /i "...
by siberia-man
04 Aug 2020 21:03
Forum: DOS Batch Forum
Topic: Run Here tool
Replies: 4
Views: 666

Run Here tool

I am happy to announce my tiny tool that allows to manage the so called PowerToy add-ons powered to run some commands over folders and drives. There is short description explaining the usage of the tool when it is ran with no arguments: Open the command identified by the menu over the folder. run-he...
by siberia-man
13 Jul 2020 00:43
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 12
Views: 1518

Re: Figuring out which computer is being used at two different locations

As far as I understand your concern -- you need to distinguish two PCs that are set up identically. If everything (or more precisely -- almost everything) is similar each other, you need a way to find out their uniqueness or make them unique. I think you have already done it: So far the only thing I...
by siberia-man
27 Jun 2020 08:30
Forum: DOS Batch Forum
Topic: JREPL - Combine Data From Two Files By Matching Strings
Replies: 5
Views: 1111

Re: JREPL - Combine Data From Two Files By Matching Strings

Let's consider FILE1 is as follows: 3498=ABC Company 73=First Hospital 78=Best Organization and FILE2 is: 3498-0112=General Expenses 73-0001=Bills 73-0292=Documents 78-0003=Human Resources and the js-script combining both files in the mode you want is called FILECOMBINER.js: var STDIN = WScript.StdI...
by siberia-man
17 Apr 2020 15:09
Forum: DOS Batch Forum
Topic: Using JREPL to extract only the first occurrence of a certain "bracket"?
Replies: 4
Views: 1969

Re: Using JREPL to extract only the first occurrence of a certain "bracket"?

Sorry for some kind of ads to my tool when you asked how to work with another one. What about the alternative from https://www.dostips.com/forum/viewtopic.php?f=3&t=9476&hilit=wsx ? It works as the swiss watches: wsx /n /e:"m = LINE.match(/StartTriggerString(.*?)EndTriggerString/); m && print(m[1])"...
by siberia-man
19 Mar 2020 13:16
Forum: DOS Batch Forum
Topic: Using Double Pipe in IF command
Replies: 5
Views: 1992

Re: Using Double Pipe in IF command

Batch syntax is extremely poor and doesn't support more complicated conditions.
You could try Conditionals on steroids which enables more benefits.
by siberia-man
14 Mar 2020 19:15
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 12
Views: 3296

Re: Get line with highest numerical string

Also (in addition to dbeham's suggestion) the wsx tool can help you to get the required result: wsx /n /e:"m=LINE.match(/^outbox\/logs\/.*?(\d+)\.log$/)||next();n=Number(m[1]);if(n>max){max=n;str=LINE}" /begin:"str='';max=0" /end:"echo(str)" test.txt wsx /n /e:"m=LINE.match(/^outbox\/logs\/.*?(\d+)\...