archive.is webpage capture | からアーカイブ | 2016年5月1日 19:10:29 UTC | |
からリダイレクト | このURLからは、他のスナップショットはありません | ||
すべてのスクリーンショット, | ドメインから api.viglink.com ドメインから www.commandline.co.uk | ||
ウェブページスクリーンショット | |||
[back] | See also CHP (Create Hidden Process) |
|
||||||||||||||||||||||||||||||||||||||
Cmdow is now Open Source Software (released under the MIT license)
Cmdow is a Win32 commandline utility for NT4/2000/XP/2003/2008/7 that allows windows to be listed, moved, resized, renamed, hidden/unhidden, disabled/enabled, minimized, maximized, restored, activated/inactivated, closed, killed and more. It is a small standalone executable. It does not create any temporary files, nor does it write to the registry. There is no installation procedure, just run it. To completely remove all traces of it from your system, delete it. Cmdow was written with batch file programmers in mind. Particular attention has been paid to Cmdows output making it easy to process with the 'FOR /F' command found in NT4/2000/XP/2003/2008/7. Cmdow is simple and intuitive to use. To list all its options, type cmdow /?. For detailed help on any option type cmdow /? <option>. Eg cmdow /? /run. If you want to start using Cmdow right away, skip to examples.
|
||||||||||||||||||||||||||||||||||||||
Usage 1. Lists window details and has the following commandline options:- CMDOW [window | /T] [/B] [/F] [/P] |
||||||||||||||||||||||||||||||||||||||
window | Window to list. If not specified all windows are listed. Specify a window by its unique handle in hexadecimal format (0x1A0142) or its caption (case insensitive). Wildcards may be used. Windows without captions may be specified by their ClassName. The At symbol '@', may be used to refer to this window ie 'CMDOW @'. Use double quotes for captions containing whitespace or control characters. | |||||||||||||||||||||||||||||||||||||
/T | List only the windows shown on the taskbar (these are typically visible level 1 windows that do not have an owner). | |||||||||||||||||||||||||||||||||||||
/B | Bare format. Does not print the field names when listing windows. | |||||||||||||||||||||||||||||||||||||
/F | Full format. By default CMDOW truncates Image names to eight characters and Captions/ClassNames to 38 (10 if listing window position). Use this option to disable this feature. | |||||||||||||||||||||||||||||||||||||
/P | Shows window position, coords of top left corner of the window and its absolute width and height in pixels. | |||||||||||||||||||||||||||||||||||||
Here is a description of the output fields:- | ||||||||||||||||||||||||||||||||||||||
Handle | Handle of the window, in hexadecimal format (0x0123AB). | |||||||||||||||||||||||||||||||||||||
Lev | Level of the window. The desktop window at level 0 is the area on which all other windows are painted. Top level windows are level 1 (and may be shown on the taskbar), all windows of level 2+ are child windows. | |||||||||||||||||||||||||||||||||||||
Pid | Process Id of the window (Task Manager also shows Pids). | |||||||||||||||||||||||||||||||||||||
Window status | How the window is displayed (Minimized, Maximized, Restored, Active, Inactive, Enabled, Disabled, Visible or Hidden). | |||||||||||||||||||||||||||||||||||||
Left, Top | Coords of left top corner of the window relative to the parent window. For top level windows this is the desktop, and for child windows it is their top level window. | |||||||||||||||||||||||||||||||||||||
Width, Height | Absolute width and height of the window in pixels. | |||||||||||||||||||||||||||||||||||||
Image | Executable that created the window (Task Manager also shows Image Names on its Process tab). | |||||||||||||||||||||||||||||||||||||
Caption |
Window title. If a window has no caption, its ClassName is listed instead.
|
|||||||||||||||||||||||||||||||||||||
Usage 2. Performs a single action typically affecting all windows and has the following commandline options:- CMDOW /TH | /TV | /CW | /MA | /UW | /AT | /FS | /WM |
||||||||||||||||||||||||||||||||||||||
/TH | Tiles all windows horizontally. Functionally equivalent to right-clicking the taskbar and selecting 'Tile Windows Horizontally'. | |||||||||||||||||||||||||||||||||||||
/TV | Tiles all windows vertically. Functionally equivalent to right-clicking the taskbar and selecting 'Tile Windows Vertically'. | |||||||||||||||||||||||||||||||||||||
/CW | Functionally equivalent to right-clicking the taskbar and selecting 'Cascade Windows'. | |||||||||||||||||||||||||||||||||||||
/MA | Minimizes all windows. Functionally equivalent to right-clicking the taskbar and selecting 'Minimize All Windows' or using the keyboard shortcut Win+M. A window may not be minimized if it has a modal dialog box open (typically the window displayed by Help | About). | |||||||||||||||||||||||||||||||||||||
/UW | Undo the effect of /TH, /TV, /CW and /MA. Functionally equivalent to right-clicking the taskbar and selecting 'Undo ...' or using the keyboard shortcut Win+Shift+M. | |||||||||||||||||||||||||||||||||||||
/AT | Similar to the keyboard shortcut Alt+Tab but instead of activating the next highest window in the Z order, /AT activates the window at the bottom of the Z order. Consequently, /AT can be used to activate every window on the taskbar sequentially. | |||||||||||||||||||||||||||||||||||||
/FS | Switches the window running this process into full screen mode (equivalent of pressing [Alt]-[Enter]) | |||||||||||||||||||||||||||||||||||||
/WM |
Switches the window running this process into window mode (equivalent of pressing [Alt]-[Enter]) |
|||||||||||||||||||||||||||||||||||||
Usage 3. This form of CMDOW performs the specified action(s), IN THE ORDER IN WHICH THEY ARE SPECIFIED, 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. Here are the commandline options:- 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 act on. Specify a window by its handle (in hex format, eg 0x1A0142) or caption (window title). Caption is case insensitive. Use asterisk before/after caption to match zero or more characters. Windows without captions are matched by their ClassName. Use double quotes for captions containing whitespace or control characters. The At symbol '@' may be used to refer to this window. eg 'CMDOW @ /HID'. |
|||||||||||||||||||||||||||||||||||||
/ACT | Activates the specified window. It's possible to activate a hidden and/or disabled window (although doing so will not make it visible or enabled). If a minimized window is activated, it remains minimized. | |||||||||||||||||||||||||||||||||||||
/INA | Inactivates the specified window (activates a window shown on the taskbar with the lowest Z order). If the specified window is already inactive or it is the only window shown on the taskbar, then /INA has no effect. This action added for completeness rather than usefulness. | |||||||||||||||||||||||||||||||||||||
/ENA | Enables the specified window (allowing user interaction). | |||||||||||||||||||||||||||||||||||||
/DIS | Disables the specified window. A disabled window will continue to run as usual, although it will not accept user input until it is enabled. | |||||||||||||||||||||||||||||||||||||
/VIS | Unhides the specified window (make it visible). | |||||||||||||||||||||||||||||||||||||
/HID | Hides the specified window. Although a hidden window will not be shown on the taskbar, it will still run and may be unhidden later. | |||||||||||||||||||||||||||||||||||||
/MIN | Minimizes specified window. Not all windows can be minimized, dialog boxes for instance. | |||||||||||||||||||||||||||||||||||||
/MAX | Maximizes specified window (even those not having a Maximize button). | |||||||||||||||||||||||||||||||||||||
/RES | Restores the specified window to its former size and position. If a minimized window was originally maximized, then /RES will maximize the window. Applying /RES a second time, will restore the window to the size and position it was before it was maximized. | |||||||||||||||||||||||||||||||||||||
/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. | |||||||||||||||||||||||||||||||||||||
/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. | |||||||||||||||||||||||||||||||||||||
/SIZ | Resizes the specified window. The width and height arguments specifiy 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. | |||||||||||||||||||||||||||||||||||||
Multiple actions are performed in order, from left to right. If more than one window matches the specified caption, CMDOW only acts on the first one. To override this add the /DBM (Don't Blame Me) switch - BE CAREFUL - you can easily hang your computer using this switch! |
||||||||||||||||||||||||||||||||||||||
Usage 4. This form of CMDOW executes the specified file or opens it using the the application associated with the filename extension. CMDOW /RUN [state] file [args] |
||||||||||||||||||||||||||||||||||||||
/RUN | Executes the specified file if possible, otherwise opens it using the the application associated with the filename extension. | |||||||||||||||||||||||||||||||||||||
state | Requests how the applications window is initially displayed. Use /MIN for minimized, /MAX for maximized and /HID for hidden. If omitted the application is started in its default show state. Some applications ignore this, use CMDOW to alter the window state after the application has started. | |||||||||||||||||||||||||||||||||||||
file | File to execute/open. Use double quotes if filename contains spaces. | |||||||||||||||||||||||||||||||||||||
args |
Optional arguments passed on to the application. Specify any args exactly as you would if executing/opening the file directly.
|
|||||||||||||||||||||||||||||||||||||
View the Cmdow main help screen:-
View help about the /MOV (move a window) option:-
To list details of all windows:-
To list details of only the windows listed on the taskbar:-
To list details and positions of only the windows listed on the taskbar:-
To list details of a particular window:-
Tile all windows vertically:-
Bearing in mind that the Cmdow actions are carried out in the order in which they are specified (that is, from left to right), this example restores, moves, renames and finally activates Calc.exe:-
Batch file to activate a different window every 10 seconds:-
Batch file to close all windows listed on the taskbar:-
Stupid batch file to remove all the buttons from Calculator:-
Batch file to retrieve display resolution. The co-ords of the first window listed by Cmdow is the screen resolution (this window also has a level of zero which can be identifed using FOR /F):-
Run a program hidden:-
Run a batch file hidden passing it parameters:-
Batch file to alert Administrator if the number of windows shown on the taskbar changes (as might be the case when an application or the operating system generates an error message, or may be backup software is prompting for a tape etc). Loops every 60 seconds until number of windows changes.
Creating an Autorun CD. Copy your autorun.inf file and cmdow.exe to the root of the CD. Here is a sample autorun.inf. It also shows how add a context menu for the CD. This could be used to install software required by your CD or to view a readme file etc:-
Here is another use suggested to me by a CMDOW user:- CMDOW can be used to save the window status and restore it, after the execution of a program. For example, if you are displaying information in a maximised Command Prompt window and then need to call a program (NOTEPAD, perhaps), which gives a second window, the current Command Prompt window is minimised to the taskbar. You would normally need to click on it to restore the original window and give it the focus. You can use CMDOW to save the status of the window, and cause it to be restored automatically in a maximised form, using the following:
|
||||||||||||||||||||||||||||||||||||||
Q. If I use "cmdow /run /hid" or "cmdow @" to run a program, a cmd window is briefly displayed. How can I completely silently run my program? A. See CHP (Create Hidden Process) BTW, this is normal behaviour as cmdow.exe is a console based executable (as opposed to window based). Console based executables are executed by cmd.exe and it's the window created by cmd.exe that 'flashes' on your screen.Q. How can I disable or hide the desktop?
A. Running Cmdow without any options lists all windows. The window at the top of the list is the desktop window only as far Windows is concerned (and has a level of 0). However, the window that you and I know as the desktop is found at the end of the list. It will typically be the last window listed with a level of 1 (and by default its caption is "Program Manager"). Q. On a W2K machine running a number of applications that monitor our servers and networks, I have a batch file that runs Cmdow /AT every 20 seconds. Sometimes Cmdow fails to activate an application window, instead the taskbar flashes blue. A. This is a new 'feature' of W2K. Its known as Foreground Lock Timeout, and basically prevents another application setting the foreground window. You can safely disable this feature using TweakUI or by setting the value of this registry key to zero:- HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout Q. When I use Cmdow at a command prompt or in a batch file and try to change the console title. Why does the title revert back when Cmdow finishes or when the batch file ends? A. This has been fixed in version 1.4.1. Q. How can I undo the effects of tiling, cascading or minimizing all windows? A. In version 1.4.2 the /UM switch has been superseded by /UW. This new switch will undo the effect of tiling/cascading and minimizing all windows. To maintain compatability with existing scripts, the /UM switch can still be used even though it's no longer documented on Cmdow's helpscreen. /UM now has exactly the same effect as /UW. |
||||||||||||||||||||||||||||||||||||||
|