I've tested your example. In fact, it doesn't work because you try to call the script by name and extension .bat . Try the same without extension. C:\>type z.bat @ECHO OFF CALL heredoc :testlabel1 & GOTO :testlabel1 SET DataFile=users.txt @ECHO BEGIN ---------------------------------------------...
Hi mirrormirror , There is error that comes from the line 60 of the heredoc.bat script. Most probably you have entered error while copying from the forum. Please check that you have stored the script correctly. You can take this from the repository https://github.com/ildar-shaimordanov/cmd.scripts/b...
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...
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 "==== ...
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 ...
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...
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...
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...
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...
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...
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%%...