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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Minimize CMD window when starting db

Status
Not open for further replies.
Oct 24, 2002
512
US
I've decided to use a batch file to copy my frontend from the server to the user's PC if it's a newer version. The batch file also opens up the frontend and the user is prompted for their db password. In case you're interested, I found the instructions at
Here's my problem. The batch file appears in a small command window at the top of my screen and forces my db application to use only the bottom half of my screen.

Does anybody know how I can force the command window to minimize so that, hopefully, my db will use the entire screen? I don't find a DOS command that performs this function. (e.g., I was hoping to type Min or Minimize in the first line of my batch file but no such luck.) Ann
 
Ann,
Rather than use a bat file, try using VBScript.

I uses this to get my front end updated:


Dim strOldPath 'Path to Users mde file
Dim strNewPath 'Path to new mde file on server
Dim FSO 'File System Object

strOldPath=left(wscript.scriptfullname,len(wscript.scriptfullname)-len(wscript.scriptname)) & "ImpactXP.mde"
strNewPath ="\\WYP_MANS_1\Impact$\ImpactFrontend\ImpactXP.mde"

Set FSO = CreateObject("Scripting.FileSystemObject")

do while FSO.FileExists(Left(strOldPath, len(strOldPath)-3) & "ldb")=True
'As long as an ldb file exists, someone is in the database, so just do nothing until it goes.
loop
Set WshShell = WScript.CreateObject("WScript.Shell")

FSO.CopyFile strNewpath,strOldPath,True
'Copy the new file over the top of the old
wshshell.run stroldpath , 3
'Open the new file (which is in the same place as the old) with a maximized window.


Copy this into a text file, make the appropriate changes. This script is designed to be stored in the same directory as the front end file, so it calculates its current position.

Save it as a file with a .vbs extension, then away you go!

The way my system works is there is a version table in the front end. On start up the current file checks the version of the one on the server. If there is a new version, the frontend fires up the VBScript, then shuts down. The script takes over from there.

Enjoy.

B ----------------------------------------
Ben O'Hara
----------------------------------------
 
Thanks Ben. I have to tell you that I don't the first thing about VBScript. Actually, I'm not sure I've ever even heard of it. There are lots of words in your code that are new to me so I'll have to study it a bit.

Is this something I can simply type out using Notepad then save the file with the vbs extension. Or, do I need some sort of software package (e.g., Visual Basic)? Ann
 
It's like batch files for the new generation! Put it in a text file & go!
If you have IE4 or above installed on your machine, then you should have it, failing that, you can download it for free from Microsoft. There is also a help file you can download from them too.
There are loads of tutorials and examples on the web, have a look round. IT's basically a cut down version (I'll get shot for calling it that!) of VB, and is very similar to VBA found in Access.

Have fun, it's really quite powerful. If you get stuck, let me know or there are VBScript forums here:forum329

Ben ----------------------------------------
Ben O'Hara
----------------------------------------
 
By the way, I'd still like to know how to minimize the command window if anybody has any ideas. Ann
 
I visited the Windows 2000 forum and somebody told me about changing command prompt properties from the Start menu. There's an option to run minimized and, by golly, it does run minimized if you call the prompt from the Start menu.

However, if the prompt is called from my batch file I have the problem as originally described. At any rate, even if it had run minimized as I hoped, I'd need a way to turn the minimize property on and off in my text file so my users would see their "normal" command prompt when they weren't running my application.

Ideas? Does anyone know of a more appropriate forum where I can post this problem? Ann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top