Running batch file in small window

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
silent
Posts: 44
Joined: 28 Oct 2011 14:40

Running batch file in small window

#1 Post by silent » 23 Jan 2012 10:10

Hi,i want to make a batch file that will always open in a small window
like
______________________________
|TITLE _ X |
|_____________________________|
| text |
| |
| text |
|_____________________________|
I have seen a batch file that was opening in a small window like this,but it was compiled to exe and i couldnt see the code.

Thanks in advance

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: Running batch file in small window

#2 Post by !k » 23 Jan 2012 10:59

Code: Select all

mode con cols=30 lines=10
pause

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: Running batch file in small window

#3 Post by alan_b » 24 Jan 2012 11:49

MODE CON: has a diabolical bug
it not only sets the size of the window,
it simultaneously sets the buffer size,
hence there are no scroll bars and once you get to the bottom of the window everything that goes above the top is forgotten history.

That is my experience under Windows 7 Ultimate.

Is there any way to avoid this loss of history please,
either an undocumented option with Mode CON:,
or a totally different way of doing things ?

NB I am not as desperate for a solution as when I first hit this feature,
For my specific needs I merely had to set the width to a larger default size to accommodate longer text lines without wrap-around,
and that left the vertical sizes of display and buffer at their different default sizes.

Regards
Alan

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Running batch file in small window

#4 Post by Ed Dyreen » 24 Jan 2012 12:01

'
Hi Alan,

CMDOW respects screen buffers, but is a false positive to many AV-software :!:

Code: Select all

@echo off

cmdow run /?
cmdow.EXE /? /siz
cmdow.EXE @ /siz 300 300
pause

Code: Select all

CMDOW [Version 1.4.3] Win32 Commandline Window Utility for NT4/2000/XP.
(C) Copyright 2001-2004 Ritchie Lawrence, http://www.commandline.co.uk.

  CMDOW [window | /T] [/B] [/F] [/P]
  CMDOW /TH | /TV | /MA | /CW | /UW | /AT | /FS | /WM
  CMDOW window {[/ACT] [/INA] [/ENA] [/DIS] [/VIS] [/HID] [/MIN] [/MAX] [/RES]
        [/TOP] [/NOT] [/REN caption] [/MOV left top] [/SIZ width height] [/CLS]
        [/END]}
  CMDOW /RUN [state] file [args]

  window  List specified window (if omitted, all windows are listed).
  /T      List windows only shown on the taskbar.
  /B      List windows using bare format (no heading information).
  /F      List windows showing full information (don't truncate any fields).
  /P      List windows showing position and size (left, top, width and height).

  /TH     Tile windows horizontally.    /TV     Tile windows vertically.
  /MA     Minimize all windows.         /CW     Cascade windows.
  /UW     Undo tile/minimize/cascade.   /AT     Intelligent [Alt]-[Tab]
  /FS     Switch to full screen mode.   /WM     Switch to window mode.

  /ACT    Activate specified window.    /INA    Inactivate specified window.
  /ENA    Enable specified window.      /DIS    Disable specified window.
  /VIS    Unhide specified window.      /HID    Hide specified window.
  /MIN    Minimize specified window.    /MAX    Maximize specified window.
  /RES    Restore specified window.     /REN    Rename specified window.
  /TOP    Make window always on top.    /NOT    Make window not always on top.
  /MOV    Move specified window.        /SIZ    Resize specified window.
  /CLS    Close specified window.       /END    Kill process linked to window.

  /RUN    Executes or opens specified file using associated application.
  state   Initial show state of window (/MIN, /MAX or /HID). Default is normal.
  args    Optional commandline arguments passed to launched application.

  Specify a window by its caption (case insensitive) or handle in hex format.
  The At symbol '@' may be used to refer to this window. For more help on any
  parameter use CMDOW /? <parameter>. Eg CMDOW /? /RUN or CMDOW /? window.
This form of CMDOW performs specified action(s) on the specified window.
Some of these commands allow you to manipulate windows in ways not normally
possible. Improper use may cause unexpected results and system instability.

  CMDOW window {[/ACT] [/INA] [/ENA] [/DIS] [/VIS] [/HID] [/MIN] [/MAX] [/RES]
        [/TOP] [/NOT] [/REN caption] [/MOV left top] [/SIZ width height] [/CLS]
        [/END]}

  window  Window to perform action(s) on. Specify a window by its unique handle
          in hexadecimal format (0x1A0142) or its caption. Windows without
          captions can be specified by their ClassName. The At symbol '@', may
          be used to refer to this window. ie 'CMDOW @ /HID'
  /REN    Renames the caption of the specified window to the caption specified
          after /REN. Use double quotes for captions containing whitespace.
  /MOV    Moves the specified window. The left and top arguments specify the
          new position of the left top corner of the window. For level one
          windows this relative to the desktop, and for child windows this is
          relative to its parent window. Level one windows can be moved off the
          screen using negative coords or coords greater than the desktop size.
          You should not move a minimized or maximized window without first
          restoring it.
  /TOP    Makes the specified window always on top. It will remain on top even
          when another window is activated. If two or more windows have this
          attribute set, the topmost window will be that which had the
          attribute set first.
  /NOT    Makes window not always on top. This is the normal setting for most
          windows.
  /SIZ    Resizes the specified window. The width and height arguments specify
          the new absolute width and height. In general, windows cannot be made
          smaller using /SIZ than they could if using conventional methods. You
          should not resize a minimized or maximized window without first
          restoring it.
  /CLS    Politely asks the specified window to close. Most applications will
          repsond to this request, although some may display a message box
          asking you what to do with unsaved work.
  /END    Kills the process associated with the specified window, the result is
          all windows with the same Pid are also killed. Use very carefully.

  If more than one window matches the specified caption, CMDOW uses the first
  one found. Multiple actions are performed in order, from left to right. Eg

    CMDOW 0x0E0144 /hid /ren "10% complete" /mov 0 0 /siz 300 100 /act /vis
I wouldn't worry about it though, some anti-virus software used kernel-hooking ( dangerous ), and many use rootkits even today. Pointing the finger at someone else is just ridiculous :mrgreen:

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: Running batch file in small window

#5 Post by alan_b » 24 Jan 2012 12:17

I have no qualms about the safety of your recommendation,
BUT
I am creating a BAT script for use by novices on a different forum,
and the moderators there may ban a link to a utility that triggers A.V. alerts.
I want to stay within the confines of what is built into Windows XP and upwards

Regards
Alan

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Running batch file in small window

#6 Post by aGerman » 24 Jan 2012 12:27

Haha, you're right Alan. But CMDOW is an old well-known tool. I don't use it because my A.V. don't like it. (But it also don't like some of my own harmless tools written in C++ :lol:)

Regards
aGerman

Post Reply