• How to Maximize Window from Batch file that Opened the Window

    Home » Forums » AskWoody support » Windows » Windows – other » How to Maximize Window from Batch file that Opened the Window

    Author
    Topic
    #502055

    I am using the AutoExec.bat file to start the desired program in WinXP running in Virtualbox. (The program will not install in Win8.) That part is working fine but I would like the program’s to open in a maximized window. Can anyone think of a way to accomplish that?

    Thanks,
    Bill

    Viewing 11 reply threads
    Author
    Replies
    • #1527045

      Bill,

      Rather than using AutoExec.bat I created a shortcut to a program (Revo Uninstaller Free). In the shortcut’s properties I set it to start Maximized (Run: box) and saved. Then I placed the short cut in the Startup [noparse](“C:Documents and SettingsUSERIDStart MenuProgramsStartup”)[/noparse] Folder. Rebooted and Revo started right up maximized.

      HTH :cheers:
      41959-VBAutoStart

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1527109

      It may be possible to use the Command Prompt START command. Have a look at START /?
      Because of a minor bug, it is usually best to specify a title, even a null one, as in
      START “” /MAX

      BATcher

      Plethora means a lot to me.

    • #1527136

      OK, the first thing I tried was RG’s suggestion to put a shortcut in the startup folder and that has not worked! The same shortcut on the virtual WinXP desktop works fine. So, this morning I tried using the Start command suggested by BATcher. It also doesn’t work in the AutoExec.bat file but it works fine when typed into the CMD window!:confused:

      This little effort has one complication: I want this program to start in a specific host folder so that it will use the real data files that are being backed up properly. That host folder has been assigned the drive letter F. In the case of the shortcut, I could use the Start In parameter to accomplish this. It did not like my specifying the string that identifies that host folder but when I switched to using F: it worked OK when manually initiated. In the case of using the Startup folder, I have used the F: designation in the shortcut in that folder.

      Maybe the need to run in a host folder is causing a problem, although it works fine that way when starting in Normal window mode. Later today I will look into letting it use the files in the virtual folder and then copying them into the backed up folder during VB shutdown. I’ll let you know the results when I get them.

      Thanks for helping.
      Bill

      • #1527285

        It also doesn’t work in the AutoExec.bat file but it works fine when typed into the CMD window!:confused:

        l

        Windows NT and its descendants Windows XP and Windows Vista parse AUTOEXEC.BAT when a user logs on. As with Windows Me, anything other than setting environment variables is ignored

        On Windows NT and its derivatives, Windows 2000, Windows Server 2003 and Windows XP, the equivalent file is called AUTOEXEC.NT and is located in the %SystemRoot%system32 directory. The file is not used during the operating system boot process; it is executed when the MS-DOS environment is started, which occurs when an MS-DOS application is loaded.

        https://en.wikipedia.org/wiki/Autoexec:cheers:

        🍻

        Just because you don't know where you are going doesn't mean any road will get you there.
    • #1527145

      Bill,

      Could you post a screen shot of your virtual machine and the shortcut properties like I did in my post?

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1527182

      OK, here is the screenshot of the shortcut in the startup folder in WinXP in the VirtualBox.

    • #1527185

      Bill,

      The only thing that I see that could possibly be a problem is that your F: is a mapped drive and may not be mapped when the program attempts to start. Try putting the URL directly in the Startin box and see if that helps. You could check your log files and see if anything is noted there also.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1527190

      Actually, I used the URL to start with and was told on the first try that it could not be used in a batch file, or something to that effect. That may be the problem. In my earliest attempts at this I was using DOS commands in the AutoExec.bat file and they worked every time but the program window was not maximized. Actually, I was using the F: drive letter back then too but it seemed to be working reliably. Do you know if the Startup folder contents is executed before the AutoExec file?

      Can you tell me how to find the log files you referred to?

      Thanks,
      Bill

      • #1527192

        Do you know if the Startup folder contents is executed before the AutoExec file?

        Sorry Bill I don’t.

        Can you tell me how to find the log files you referred to?

        Just start up the EventViewer.

        HTH :cheers:

        Thanks,
        Bill[/QUOTE]

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

    • #1527210

      I have reviewed the items in the event viewer dated today pretty thoroughly and I don’t see anything that seems to be connected to what I was doing with the VB.

      I’m going to try one more thing. I’ll go back to the AutoExec file approach and build in a delay ahead of the attempt to start the program.

      Thanks for helping.
      Bill

    • #1527211

      Bill,

      Did you check the EventViewer in the VM? :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1527338

        Bill,

        Did you check the EventViewer in the VM? :cheers:

        That’s a really good point! I hadn’t thought of that. So, I did check the event viewer in the VM last night and didn’t find any suspicious looking entries.

        The next post in this thread looks promising; I’ll look into it.

        Thanks,
        Bill

    • #1527340

      wavy, thanks for the info on AutoExec.bat vs AutoExec.NT! I tried moving my 2-line command below to AutoExec.NT and that didn’t help!
      ——
      F:
      Start “” /MAX “C:Program FilesInfo Selectis.exe”
      ——
      I double checked my Start command by opening a CMD window and typing it in there and it works fine when executed in that environment. So, it seems likely, as RG said earlier, that the F: drive letter assignment isn’t getting set up before the AutoExec file is executed.

      I just tried adding an ASSIGN command to the AutoExec.NT file to assign a drive letter to the URL for the program data folder. That didn’t help during a reboot so then I entered the ASSIGN command in a CMD window and it said that ASSIGN was not a recognized command! So I guess I’m stuck again!

      Thanks for the info.
      Bill

    • #1527348

      Just a wild guess, but assuming the F: drive is not getting recognized early enough how about a dir F: placed before the is.exe??

      :cheers:

      🍻

      Just because you don't know where you are going doesn't mean any road will get you there.
    • #1527356

      Well, David, that sounded like a good idea but unfortunately it didn’t help!:( There seemed to be more delay at about that point in the opening process but I imagine that was caused by the errors it encountered at that point in the startup. I’ll just live with having it open in Normal window mode and pop it up manually if I need to.

      Thanks for trying!
      Bill

    Viewing 11 reply threads
    Reply To: How to Maximize Window from Batch file that Opened the Window

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: