CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346

    Run DOS program before windows

    I want a program to run after the POST test, but before windows begins to load. I know this can be acheived with batch files, but how? How do i get a batch file to run when you turn the computer on? (besides going into dos mode and typing in the command) If i can just edit an existing batch file that'd be fine too, all i need to do is insert a command to run a program. thanks for any help you can give me.

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

  2. #2
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    On win 3.x, 95 & 98, just stick it into autoexec.bat.

    Don't know about NT, ME, 2K & XP although ME might be the same as 98.
    Succinct is verbose for terse

  3. #3
    Join Date
    Jan 2001
    Posts
    588
    Me is exactly the same as 98 in this regard. Unfortunately, for NT/2000/XP, there's not much you can do. In Win9x, after POST, DOS is loaded, and the autoexec.bat is run, which contains a line to load Windows. NT/2000/XP have no underlying DOS layer. This means that after POST, the first and only thing that gets loaded is Windows itself. I'm not sure if there's a way to supercede this or not; you may want to try a question in a Windows programming forum for more specialized people to help you.

  4. #4
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346
    thanks for all the feedback, i knew it was autoexec.bat, however i wasn't sure because if i did a windows search for the file, opening it actually atempted to run the batch file, not edit it. But the little light bulb turned on so i went to dos prompt and typed EDIT autoexec.bat and did what i needed. Just one question though, should I load my program first before any other commands or not?

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

  5. #5
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    I don't think it matters whether your program is run first or not: as long as it returns. If it doesn't return, windows will not boot up. If it is just a TSR installation, it doesn't matter when it is executed.
    Succinct is verbose for terse

  6. #6
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    In WinNT / 2K / XP you can write a service and make it load at boot time. This is not exactly before everything else, but depending on what you want to do it might be OK.

  7. #7
    Join Date
    Sep 2002
    Location
    Belarus - Tirol, Austria
    Posts
    647
    It is not simple service, it's kernel driver (driver service).
    Only kernel drivers can be successfully loaded at boot time. It can not use for exemple win32-subsystem calls because at boot time win32-subsystem also not loaded.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured