Search found 120 matches

by jfl
29 Apr 2018 02:22
Forum: DOS Batch Forum
Topic: Alternate method to get TAB, Carriage return and possibly all others
Replies: 32
Views: 8607

Re: Alternate method to get TAB, Carriage return and possibly all others

the contents of every 32 and 64 bit windows PE Image(Executables, DLLs, OCX,...) starts with a tiny DOS stub header known as MZ header which have enough logic to display the message "This program cannot be run in DOS mode." Every 32 and 64 bit PE image does indeed start with a DOS stub, but the DOS...
by jfl
29 Apr 2018 01:56
Forum: DOS Batch Forum
Topic: Special Character issues
Replies: 1
Views: 667

Re: Special Character issues

There's a missing double quote at the end of the last argument of the cscript command. It should be: ... "%URL%" ' With this, the # and ! characters make it through easily. For example this test script: @if (@a==@b) @end /* @echo off setlocal set "URL=http://127.0.0.1:99999/page/index.html#!/area/99...
by jfl
14 Apr 2018 10:39
Forum: DOS Batch Forum
Topic: Tabbed console window is comming
Replies: 3
Views: 917

Re: Tabbed console window is comming

Well sometimes I have 4 or 5 consoles open. And when on the laptop internal screen it's easy to get lost and enter commands in the wrong one. I'm looking forward to having that tabbed console then.
by jfl
26 Mar 2018 10:12
Forum: DOS Batch Forum
Topic: Mask password with Asterisk
Replies: 11
Views: 5397

Re: Mask password with Asterisk

Antonio's routine in post #7 above fails when a password contains the ! character. (The first actual password I tried contains one!) Here's an updated version with a fix. @echo off setlocal call :ReadPassword pass="Enter password: " setlocal EnableDelayedExpansion echo Password read: "!pass!" goto :...
by jfl
06 Mar 2018 03:07
Forum: DOS Batch Forum
Topic: Store windows positions
Replies: 11
Views: 2620

Re: Store windows positions

There's a PowerShell script called window.ps1 in my system management library for doing this. There are many options. Run (window -?) or (help window -detailed) for details. Example: PS C:\WINDOWS\system32> window | ft -a hWnd Program Left Top Width Height Title ---- ------- ---- --- ----- ------ --...
by jfl
02 Mar 2018 03:39
Forum: DOS Batch Forum
Topic: Completely confused by PING 192.168.0.2
Replies: 2
Views: 1159

Re: Completely confused by PING 192.168.0.2

Hi, I have a similar situation between two machines here, a desktop and a laptop. The desktop stays; The laptop comes and goes. The desktop accesses a share on the laptop drive as drive U:. One difference with your scenario is that I don't use subst.exe for generating a drive letter, but net.exe its...
by jfl
25 Feb 2018 12:58
Forum: DOS Batch Forum
Topic: Why REM inside a block?
Replies: 14
Views: 3782

Re: Why REM inside a block?

As the cryptic (call)s also confuse me, I usually hide them behind macros: set "TRUE.EXE=(call,)" &:# Macro to silently set ERRORLEVEL to 0 set "FALSE.EXE=(call)" &:# Macro to silently set ERRORLEVEL to 1 The names come from the eponymous commands that do the very same thing in Unix. I added the .EX...
by jfl
19 Dec 2017 06:22
Forum: DOS Batch Forum
Topic: using %errorlevel% or %something% in a compound batch command ()
Replies: 11
Views: 2673

Re: using %errorlevel% or %something% in a compound batch command ()

Funny coincidence, I was about to ask the same question, but in a slightly different context... And none of the above solutions seem to work there: I'm trying to filter the output of a command in a make file, to select the output lines I'm really interested in. The problem is the same when trying to...
by jfl
14 Dec 2017 15:54
Forum: DOS Batch Forum
Topic: Help, Bat file to monitor scheduled tasks.
Replies: 6
Views: 3877

Re: Help, Bat file to monitor scheduled tasks.

To monitor something really reliably for a long time, it is much better use a Windows service. The advantage of a service is that it's basically indestructible. If Windows Update decides in the middle of the night that your PC needs a critical update, and hard-reboots your PC, your service will rest...
by jfl
15 Nov 2017 08:43
Forum: DOS Batch Forum
Topic: Batch bug that breaks the title bar
Replies: 2
Views: 944

Re: Batch bug that breaks the title bar

That was the purpose: My first batch prepares things for the second, and does not need it to return.
I hoped that _not_ using a call (which is legal) would speed things up a bit. I still don't know if it does, but it sure has a side effect on the title bar!
by jfl
15 Nov 2017 03:55
Forum: DOS Batch Forum
Topic: Batch bug that breaks the title bar
Replies: 2
Views: 944

Batch bug that breaks the title bar

Hi, I've just noticed a bizarre bug, which is new to me: When you run a batch file in cmd.exe, the batch command line is displayed on the title bar. And when the batch exits, the title bar changes back to the previous title. Ex: Administrator: Command Prompt But I just found a case where the command...
by jfl
16 Oct 2017 03:02
Forum: DOS Batch Forum
Topic: Cooler multi line comments.
Replies: 8
Views: 3025

Re: Cooler multi line comments.

A really great idea! It never ceases to amaze me that we can still make progress like this with this good old batch language. Of course it is a matter of a personal taste Indeed! I personally favor using :# for comments instead of ::, as the # character is used for comments by most other scripting l...
by jfl
04 Sep 2017 10:57
Forum: DOS Batch Forum
Topic: Exclude current directory from PATH search
Replies: 7
Views: 1708

Re: Exclude current directory from PATH search

Thanks Dave for sharing this useful information! I've updated my which program to test for this when displaying the pathname of the program that will run. It now skips the instance in the current directory (if any) if NoDefaultCurrentDirectoryInExePath is defined. After a bit of hesitation, I decide...
by jfl
04 Sep 2017 06:55
Forum: DOS Batch Forum
Topic: How to start multiple sub cmd.exe shells without getting lost
Replies: 1
Views: 626

How to start multiple sub cmd.exe shells without getting lost

For testing new experimental batch files, it is often wise to start a sub-shell within your cmd shell. This way, if your batch file fails and trashes your environment, you can simply return to the clean environment by typing "exit". Also, you might want to test the script from within envir...
by jfl
06 Jun 2017 09:52
Forum: DOS Batch Forum
Topic: Microsoft tool to compare 2 directories
Replies: 9
Views: 3135

Re: Microsoft tool to compare 2 directories

Try my dirc.exe tool, available in SysTools.zip there: m It's written in C, fast, supports any Unicode pathnames in any code page, long pathnames > 260 characters, junctions, symlinks, etc. There are also many options for refining the comparison. Use option -? to display a help screen. For example t...