Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

maximize running dos window 1

Status
Not open for further replies.

mrmovie

Technical User
Oct 2, 2002
3,094
GB
Good afternoon all,
i hope the weather is as sunny as it is munich,,lovely.
quick question.
i have a bat file which is executed minimized from a vb app. i would like to have the dos window visible as it shows debugging info to the user. does anyone know a dos command to run in the batch file to maximise its window?
I appreaciate i could call the batch file from the vb app which calls another batch file maximised but i dont want the extra file, call me pick-eee

cheers
von moyla
 
yes, yes i do.

at the command prompt or within a batch file:

mode con: cols=xxx lines=xxx

con: defines that its for the command window.
cols and lines are obviously the number of columns and lines
the window shall take......
for a near full size window but not max a cols=140 and lines=60 is close....

this works for windows 2000. but sure about other o/s's.

hope this helps
ccastelein
 
hello ccastelein,
sorry i havent got back to you.
thanks for the great response, i shall use this. might even comment in your name in the script for the browneee points.

regards,
von moyla
 
hmm shame to break up the party but it doesnt quite do what i hoped. running the command does change the size of the dos window but doesnt maximize it!! will keep looking
 
Since you are using VB, I presume you are using VB's Shell command to start the BAT file. If you are using SHELL you can try to use the following:


Dump1 = Shell("RunThis.bat", vbMaximizedFocus)
--or--
Dump1 = Shell("RunMax.bat", 3)


FYI from VB4's help file:
--------------------------------------------------
Syntax

Shell(pathname[, windowstyle])
--------------------------------------------------

Where the "windowstyle" has one of the following:

--------------------------------------------------
0 = vbHide (Window is hidden and focus is passed to the hidden window.)

1 = vbNormalFocus (Window has focus and is restored to its original size and position.)

2 = vbMinimizedFocus (Window is displayed as an icon with focus.)

3 = vbMaximizedFocus (Window is maximized with focus.)

4 = vbNormalNoFocus (Window is restored to its most recent size and position. The currently active window remains active.)

6 = vbMinimizedNoFocus (Window is displayed as an icon. The currently active window remains active.)

--------------------------------------------------

Let us know if this helps or not. Hopefully it does.
--MiggyD
 
Hello MiggyD
Thanks for this. I am using the command you mention. Unfortunately i dont want the default bahavour of a launched bat file to be maximized.
The VB app is a tool for installing windows XP clients. its takes an input of an ini file which lists software jobs, some 60 at the moment. the jobs have command sections to tell the VB app to reboot before, after, to sleep for a certain time, to pause(for debuggin) etc etc. I could add another command to specify the window status for a particular batch file. i dont want to do this as 95% of the time the jobs arent batch files but additional ini files so i cant be bothered to release a new version. cheers for the input though

regards,
von moyla
 
"I could add another command to specify the window status for a particular batch file."

Why would you create a seperate line for each file you want to maximize?

If you have the source code (where it supposed to "pause(for debuggin) etc etc) you could simply add an IF/ENDIF statement to the SHELL command like:


Public Sub MyPause4Debug(SomeBatch As String, WinStyle As Integer)
If WinStyle > 0 Then
Dump1 = Shell(SomeBatch, vbMaximizedFocus)
Else
Dump1 = Shell(SomeBatch)
End If
End Sub



It wouldn't necessarily be a Major Version change, just a Minor one.

--MiggyD
 
ok, 2install.exe is passed a jobs list. this list is an ini file of the following format

WXPInst\Tools\AUPD\START_PRE\wshshellprexpini.vbs$nosleep;noreboot$noseq
Winzip\WinZip\V1.0_cmdline_ml\_SCRIPT\UNA-WinzipCL-V1.0-ML.INI$nosleep;noreboot$noseq
FujitsuSiemens\DeskView\V5.30_ml\_Script\UNINST-DeskViewHidden-V5.30-en.bat$nosleep;noreboot$noseq

The above are 3 example jobs that the 2install.exe must perform. The line is delimited by a $
The first substring is file to run.
If the file is an ini file a Wrapper.exe is called. This Wrapper.exe is a gui based tool that the user can see how long the install can take, how much space it will take up, accept license agreements, cancel the install etc.
If the file is a vbs or a bat file the file is executed minimized.

my "I could add another command to specify the window status for a particular batch file." was refering to the second substring "nosleep;noreboot". commands to the 2install.exe delimited by ";" you can reboot after the job has run, sleep for a certain time, have a prereboot, pause etc etc. I was meaning i could potentially add a "maximize" option so that you can specify the criteria and then add the if then statement you have suggested.

However, I am of the opinion that a "job", being a batch file, vbs, exe, cmd, wsf etc etc etc should be responisible for its execution state. ie if that batch file wants to be run maximized that is no concern of the 2install.exe. It should be the job of the called "job".

That was the reason for the post, the guy who keeps perstering me to change the app just so his flippin batch file can show some crap message. lord knows why you he cant take his head out of his arse and ditch the sandals. anyhow i digress

cheers,
von moyla
 
Start the Window with the START command.

Enter START /? | MORE in a DOS window to see the options, which include minimizing, maximizing, or "regularizing" the window as well as whether to wait on the command to finish, what to put in the DOS window's title bar, etc.

START came in with Windows 95 so it's there in that and any newer (32-bit) Windows version.

- Chuck Somerville
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top