Search found 174 matches

by siberia-man
05 Jul 2016 07:22
Forum: DOS Batch Forum
Topic: If...Else If - how to make this work
Replies: 5
Views: 3398

Re: If...Else If - how to make this work

Jer You can try this one: Conditionals on steroids It allows to implement something like this one If cond1 And cond2 Then Else If cond3 Or cond4 Then Else End If in the form as here call :if cond1 && call :if cond2 && ( rem do something1 ) || call :if cond3 || call :if cond4 &&a...
by siberia-man
17 May 2016 04:50
Forum: DOS Batch Forum
Topic: We can use bash in our scripts now in Win10
Replies: 20
Views: 14481

Re: We can use bash in our scripts now in Win10

The hybrid by penpen can be improved to avoid some possible troubles if the text within multiline text for some reasons will contain the command substitutions: : > /dev/null # ^ echo ' > nul @echo off echo:==== cmd bash "%~f0" %* echo:==== cmd again goto :eof ' > /dev/null echo "==== ...
by siberia-man
19 Apr 2016 07:11
Forum: DOS Batch Forum
Topic: We can use bash in our scripts now in Win10
Replies: 20
Views: 14481

Re: We can use bash in our scripts now in Win10

Another hybrid as a combination of two solutions above. It is a bit simpler than mine or by penpen but has more limitations. : <<____CMD____ @echo off echo:cmd bash "%~f0" %* echo:cmd again goto :EOF ____CMD____ echo "bash" for n in "$@" ; do echo "$n" ; done ...
by siberia-man
19 Apr 2016 02:37
Forum: DOS Batch Forum
Topic: We can use bash in our scripts now in Win10
Replies: 20
Views: 14481

Re: We can use bash in our scripts now in Win10

bash-in-batch hybrid can be like vbs-in-batch one as it is shown here http://www.dostips.com/forum/viewtopic.php?f=3&t=5543&start=30#p37780 : # @echo off : # echo:==== cmd : # bash "%~f0" %* : # echo:==== cmd again : # goto :EOF echo "==== bash" for n in "$@&quo...
by siberia-man
28 Mar 2016 00:10
Forum: DOS Batch Forum
Topic: enhancement to cmd.exe
Replies: 1
Views: 2023

Re: enhancement to cmd.exe

Mod edit: Just a note to say that this modifies your registry to auto-load this script in the future. You will need to uninstall it to disable this feature. That is true if someone would like to install it explicitly: setcmd.bat autorun -i or uninstall it setcmd.bat autorun -u In other cases the sc...
by siberia-man
25 Mar 2016 04:00
Forum: DOS Batch Forum
Topic: enhancement to cmd.exe
Replies: 1
Views: 2023

enhancement to cmd.exe

In real life I prefer using more powerful and flexible tools like Clink, ConEmu and Far. But it was so fun to develop this script. Once executing the script setcmd.bat you will get more benefits working under cmd.exe. Mod edit #2: Just a note to say that this has an install feature to modify your re...
by siberia-man
08 Mar 2016 23:31
Forum: DOS Batch Forum
Topic: readlink emulation: first approach
Replies: 7
Views: 4124

Re: readlink emulation: first approach

jeb , this is bad news. They seem to try localize everything possible. VERBINDUNG is the German translation for JUNCTION. I am using non-localized version of Windows where all symbolic links are marked as SYMLINK, SYMLINKD and JUNCTION. I need to check how these markers are presented in Russian. Mo...
by siberia-man
08 Mar 2016 03:35
Forum: DOS Batch Forum
Topic: readlink emulation: first approach
Replies: 7
Views: 4124

Re: readlink emulation: first approach

sambul35 , good point. Of course, symbolic links are needed mostly for compatibility purposes. For example, if some application has to do with the specific directory structure and we need to keep it working in the new environment. I guess "C:\Documents and Settings" pointing to "C:\U...
by siberia-man
07 Mar 2016 03:59
Forum: DOS Batch Forum
Topic: readlink emulation: first approach
Replies: 7
Views: 4124

readlink emulation: first approach

Unix has the command readlink for printing values of symbolic links. Windows doesn't have. This post is the first attempt to close this lack. @echo off for /f "tokens=*" %%f in ( ' dir /b /al "%~1*" ' ) do for /f "tokens=1,2,3 delims=[]" %%a in ( ' dir /al "%~dp1%%...
by siberia-man
11 Feb 2016 05:28
Forum: DOS Batch Forum
Topic: Color in batch programs
Replies: 9
Views: 5644

Re: Color in batch programs

What about this one? ANSI escape-oriented PowerShell script: https://github.com/ildar-shaimordanov/cmd.scripts/blob/master/ansi.bat Reading from command line arguments ansi "\e[47m \e[0m\n\e[44m \e[0m\n\e[41m \e[0m" Reading from pipeline echo \e[47m \e[0m\n\e[44m \e[0m\n\e[41m \e[0m | ansi Reading f...
by siberia-man
21 Dec 2015 05:54
Forum: DOS Batch Forum
Topic: Problems with Batch-VBS Hybrid
Replies: 4
Views: 3859

Re: Problems with Batch-VBS Hybrid

@Meerkat:
Have you tried this script viewtopic.php?f=3&t=5543&p=37780#p37780 ?
by siberia-man
21 Dec 2015 05:52
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174680

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

The script was updated: http://www.dostips.com/forum/viewtopic.php?f=3&t=5543&p=37780#p37780

Some cosmetic changes and support for Python were done.
by siberia-man
07 Jun 2015 11:47
Forum: DOS Batch Forum
Topic: heredoc in batch
Replies: 5
Views: 6312

heredoc in batch

heredoc is way to determine multiline string literals in scripts. Unfortunately heredoc is not included to native batch scripts. The following link shows the way to embed heredoc in batch very close to the original definition: m I have made some modifications to allow heredoc be declared with the ex...
by siberia-man
07 Jun 2015 09:23
Forum: DOS Batch Forum
Topic: Tricky way to detect calls from another batch script
Replies: 7
Views: 15743

Tricky way to detect calls from another batch script

m There is fruitful discussion (in Russian) that has began as the report about bug with "goto nonexistent_label" and finished with nice way of detecting the caller script @echo off :: http://forum.script-coding.com/viewtopic.php?pid=94390#p94390 if not defined CMDCALLER ( (echo on & go...
by siberia-man
29 May 2015 19:12
Forum: DOS Batch Forum
Topic: js/vbs/html/hta and more hybrids and chimeras in cmd/bat
Replies: 61
Views: 174680

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

I am thinking to improve my cmdize script with this solution later. Ok. I did it. Script // example.js if ( this.WScript ) { WScript.Echo('hello, jscript!'); } else { console.log('hellow, nodejs!'); } Hybridization C:\>cmdize example.js C:\>example.bat hello, jscript! C:\>cmdize /e node example.js ...