Search found 66 matches

by OperatorGK
18 Apr 2016 11:00
Forum: DOS Batch Forum
Topic: We can use bash in our scripts now in Win10
Replies: 20
Views: 5752

We can use bash in our scripts now in Win10

With new Win10 update it's now possible to execute bash (or sh) scripts from command line. I made a simple hybrid bat-bash file which works fine for me on Windows 10 Build 14316: @goto :batch_part # Bash part echo Hello from bash! echo Normal syntax for variable expansion doesnt work here: %a% echo ...
by OperatorGK
30 Mar 2016 13:57
Forum: DOS Batch Forum
Topic: NEWS: UBUNTU IS COMING TO WIN10 (bash included)
Replies: 0
Views: 1960

NEWS: UBUNTU IS COMING TO WIN10 (bash included)

Today on Build conference Microsoft and Canonical announced that Ubuntu will be integrated into Win10. After the next major update we can use bash and other linux command-line programs natively!
Proof & More details: http://blog.dustinkirkland.com/2016/03/ ... ndows.html
by OperatorGK
03 Nov 2015 02:08
Forum: DOS Batch Forum
Topic: Definition and use of arithmetic "functions" in Batch files
Replies: 26
Views: 6816

Re: Definition and use of arithmetic "functions" in Batch fi

Then, why you introduced it in a thread whose purpose is to write something in the way most other programming languages does? In the opening post you used the words: a method that allows to use arithmetic expressions in Batch files in a way rather similar to arithmetic functions of other programmin...
by OperatorGK
02 Nov 2015 13:07
Forum: DOS Batch Forum
Topic: Alternative to CHOICE - need help
Replies: 8
Views: 1973

Re: Alternative to CHOICE - need help

Read this thread: viewtopic.php?f=3&t=6382 and rework posted code to suit your needs.
by OperatorGK
01 Nov 2015 10:32
Forum: DOS Batch Forum
Topic: Definition and use of arithmetic "functions" in Batch files
Replies: 26
Views: 6816

Re: Definition and use of arithmetic "functions" in Batch fi

penpen wrote:I must admit i never heard of a programming language that "naturally" supports this operator

Isn't this basically batch %x:y=z% operator? The only difference, AFAIK, is that [] operator may be used in anonymous expressions.
by OperatorGK
24 Oct 2015 12:10
Forum: DOS Batch Forum
Topic: Best trick 2 avoid control-break(Terminate batch job) prompt
Replies: 19
Views: 11777

Re: Best trick 2 avoid control-break(Terminate batch job) pr

This question is extremely old now, however, someone resurrected it 2015. No need to HEX edit CMD.EXE etc... Someone mentioned a restart too(?) The solution that I found to block CTRL+C aka Terminate Batch Y/N COMPLETELY. No Fuss, No kidding, No Breaking Out. XOUT but that too can be disabled. Brie...
by OperatorGK
23 Oct 2015 11:33
Forum: DOS Batch Forum
Topic: Best trick 2 avoid control-break(Terminate batch job) prompt
Replies: 19
Views: 11777

Re: Best trick 2 avoid control-break(Terminate batch job) pr

How you can use XCOPY for keyboard input? Never known that. dostips: how to display password in asterisk The main part to get a single character is done by Xcopy /W "%~f0" "%~f0" 2>Nul The other stuff is to build a complete string and to handle things like !, & and backspace...
by OperatorGK
23 Oct 2015 10:01
Forum: DOS Batch Forum
Topic: Best trick 2 avoid control-break(Terminate batch job) prompt
Replies: 19
Views: 11777

Re: Best trick 2 avoid control-break(Terminate batch job) pr

Squashman wrote:Why doesn't Control-C kill a batch file when it is using xcopy for input?

How you can use XCOPY for keyboard input? Never known that.
by OperatorGK
31 Aug 2015 09:53
Forum: DOS Batch Forum
Topic: Experimenting on User Input....
Replies: 12
Views: 2370

Re: Experimenting on User Input....

Meerkat wrote:
OperatorGK wrote:Strangely, this doesn't do anything on my Win10. What Windows version you are using?


Just type SC in the console first if it exists.

Meerkat

I meant, SC exists and works, but "for..." command simply doesn't do anything.
by OperatorGK
31 Aug 2015 02:47
Forum: DOS Batch Forum
Topic: Experimenting on User Input....
Replies: 12
Views: 2370

Re: Experimenting on User Input....

Strangely, this doesn't do anything on my Win10. What Windows version you are using?
by OperatorGK
15 Aug 2015 12:09
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 53
Views: 19378

Re: Rules for label names vs GOTO and CALL

_npocmaka, I tried with different %anonymous% variable value, but this thing prints nothing for me: @echo off setlocal set "anonymous=/?" for /l %%N in (1 1 5) do ( set /a N=%%N*2 call :%%anonymous%% a b c 3>&1 >nul ) if "%0" == ":%anonymous%" ( set "anonymous#...
by OperatorGK
15 Aug 2015 06:23
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 53
Views: 19378

Re: Rules for label names vs GOTO and CALL

slower when used in small scripts

:shock: What developers of cmd.exe smoked? Cause I don't know HOW to code something that works slower when used in small script.
Also, it's speed decreases with memory usage - avg. 15 sec with 1MB used, but 90 sec with 4MB used on my computer.
by OperatorGK
14 Aug 2015 14:02
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 53
Views: 19378

Re: Rules for label names vs GOTO and CALL

I was thinking of something similar, but was stumped until I saw your attempt Here is an improvement. Instead of using %1 which could be spoofed, I rely on the %0 value, which I think is difficult (if not impossible) to fake. I also opted to name the variable "private" instead of "h&...
by OperatorGK
14 Aug 2015 13:34
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 53
Views: 19378

Re: Rules for label names vs GOTO and CALL

external access It is possible! I thought not . Someone, please dump all awesome stackoverflow things here or, at least, make a list. Also, I made some nice syntax: set LF=^ set exports=^^^%LF%%LF%^%LF%%LF% Use like this: :function %exports% library.bat %* Sadly "%*" can't be removed.