Thread: Autoexec password proggie

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937

    Autoexec password proggie

    I know this probobly belongs on the Windows board, but it's more or less universal. I have a simple dos program I wrote that asks for a password, returning only if the correct password is entered. I put this program in my autoexec.bat file, guessing it would run during bootup. From what I can tell, it doesn't run, or at least the boot doesn't wait for it to return. I know it must work, though, because when I run autoexec.bat in windows, it runs the program. Yes, the program runs in true dos; not console.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    Where did you put it in auto?
    Do not make direct eye contact with me.

  3. #3
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937
    attenzi end.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  4. #4
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Can we see your autoexec.bat?
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Thread moved to the tech forum.

    What version of Windows? XP doesn't have "true dos", so I guess it isn't that then?

    In your autoexec.bat, place a "pause" command after your program. That way you can easily determine if that batch file is even being processed.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  6. #6
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937
    If "pause" makes me press any key to continue, then yes, it is being processed. I'm in Windows98- here it is:
    Code:
    REM [Header]
    @ECHO OFF                                                            
    REM [CD-ROM Drive]
    REM c:\windows\command\mscdex /d:gem001
    REM [Miscellaneous]
    REM [Display]
    REM [Sound, MIDI, or Video Capture Card]
    REM [Mouse]
    c:\windows\cwcdata\cwcdos.exe
    set PATH=C:\DJGPP\BIN;%PATH%
    set DJGPP=C:\DJGPP\DJGPP.ENV
    rem TShoot: set DJGPP=C:\DJGPP\DJGPP.ENV
    rem - By Windows Setup - MSCDEX /D:MSCD001 /V
    rem - By Windows Setup - c:\mscdex\MSCDEX /D:MSCD001 /V
    password
    pause
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  7. #7
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Try taking out the @echo off part and see if it says anything like an error message when you try to run password.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  8. #8
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937
    Ah, now that I have removed the @echo I se an error.
    something along the lines of "Error - No somethingoranother, get somethingoranother.zip"
    Does it need some library or something? I'll edit this post with the exact error when I next boot up.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  9. #9
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    put it as the shell in win.ini then make it execute explorer when the correct password is entered.

  10. #10
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    The simplest way to do this is to run your code prior to booting Windows. That way you still have control over the entire system.

    Go into your msdos.sys file - it is a text file in Win9x OS's. Change BootGUI=1 to BootGUI=0. This will tell Windows to boot only to DOS (in Win9x only, of course). Place the path to your C program in autoexec.bat. Right after it place the path to windows or just c:\windows\win.com.

    When your code exits to DOS it will resume scanning the autoexec and then will run Windows from the path you supplied. This is no different than when Windows boots up save that you are invoking win.com instead of io.sys invoking it.

    Also there are ways to totally lock out the desktop and run your code in the foreground as the only program - or the only one displayed - no icons, no start bar, no program manager, etc. There should be some info on the net about doing this.

  11. #11
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    try www.winguides.com
    all the registry keys you'll need to do the above
    PHP and XML
    Let's talk about SAX

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading a password from a file.
    By medeshago in forum C Programming
    Replies: 15
    Last Post: 12-21-2008, 07:20 AM
  2. [Q]Hide Password
    By Yuri in forum C++ Programming
    Replies: 14
    Last Post: 03-02-2006, 03:42 AM
  3. written command line password generator
    By lepricaun in forum C Programming
    Replies: 15
    Last Post: 08-17-2004, 08:42 PM
  4. Password prompt in unix w/o \b
    By rafe in forum C++ Programming
    Replies: 1
    Last Post: 10-09-2002, 08:54 AM
  5. password
    By hammers6 in forum C Programming
    Replies: 1
    Last Post: 10-10-2001, 12:14 AM