need help with batch programming
Page 1 of 5 123 ... LastLast
Results 1 to 15 of 75

Thread: need help with batch programming

  1. #1
    Join Date
    Jun 2000
    Posts
    177

    need help with batch programming

    i'm up to makeing a bootable cd with some handy dos toolz.
    what i need help with from you (the batch programmer) is to edit/rewrite the autoexec.bat file and edit the config.sys file.
    i would like the boot menu to hold one option for "boot to dos" (i what that option to have cd-rom supprt), then i want 6 options for my toolz. each tool has it own folder which is called 1, 2, 3, 4, 5 and 6.
    would be great if you (the batch progremmae) would like to set the cd-rom as z: (the last character that can be used).

    plz dl this bootdisk and edit it, http://www.drd.dyndns.org/cgi-bin/cgirdir.exe?mtn04 .

  2. #2
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    Problem #1: There are only 2,048 bytes free on that Windows 98 SE boot diskette. You'd need 3,072 just to create the 6 subdirectories, plus whatever would be needed to add your 6 "toolz" and all of their associated files.
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  3. #3
    Join Date
    Jun 2000
    Posts
    177
    The toolz in question is going to be put on the cd. So there should be no space problem.
    The problem (for me as i'm totely lost when if come to batch programming) is to set up a link from the config.sys to the files on the cd (which is done with the autoexec.bat file, on the boot diskette).
    Last edited by BOGIZ; November 1st, 2002 at 05:49 AM.

  4. #4
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    Problem #2: My limited understanding is when you boot from a CD-ROM it becomes drive A:, (and your floppy drive, that used to be A:, becomes B:). If this is true, I don't know what would happen if we then tried to assign it as drive Z: in the AUTOEXEC.BAT file (with MSCDEX.EXE).

    Problem #3: If you "burn" a boot image to CD and then close it, (so that it will be bootable), are you going to be able to "burn" anything else to that same CD?

    Problem #4: Since we don't know what "toolz" you are going to be using, all we can really do is create an example BATch file that will simply display a menu something like so:
    1. Toolz Menu
    2. Tool A
    3. Tool B
    4. Tool C
    5. Tool D
    6. Tool E
    7. Tool F
    8. Exit this Menu

      Choice? (A,B,C,D,E,F,G):
    And then, when you select any of the first 6 options all we could do is display something on-screen like:

    • You selected Menu item A.
      Press any key to return to the Menu ...
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  5. #5
    Join Date
    Jun 2000
    Posts
    177
    Originally posted by Vernon Frazee
    Problem #2: My limited understanding is when you boot from a CD-ROM it becomes drive A:, (and your floppy drive, that used to be A:, becomes B. If this is true, I don't know what would happen if we then tried to assign it as drive Z: in the AUTOEXEC.BAT file (with MSCDEX.EXE).
    Hmm A: have never become B: for me. It would be great if one is able to not block A: as it would be nice to have it free (no idea if it's a no can do).
    mscdex.exe command switches can be found at http://support.microsoft.com/default...;EN-US;q87165& .
    Here is some more links that may come handy:
    http://www.computerhope.com/batch.htm
    http://users.cybercity.dk/~bse26236/...help/BATCH.HTM
    http://www.bootscriptor.org/

    Originally posted by Vernon Frazee
    Problem #3: If you "burn" a boot image to CD and then close it, (so that it will be bootable), are you going to be able to "burn" anything else to that same CD?
    NO. if you close it, nothing more can be added. But if you don't close the sesson (i think that's the name), you can then add more to it. see http://www.cdrfaq.org/ for better explaintion.

    Originally posted by Vernon Frazee
    Problem #4: Since we don't know what "toolz" you are going to be using, all we can really do is create an example BATch file that will simply display a menu something like so:
    1. Toolz Menu
    2. Tool A
    3. Tool B
    4. Tool C
    5. Tool D
    6. Tool E
    7. Tool F
    8. Exit this Menu

      Choice? (A,B,C,D,E,F,G):
    And then, when you select any of the first 6 options all we could do is display something on-screen like:

    • You selected Menu item A.
      Press any key to return to the Menu ...
    That's fine, i can change the name myself later on.
    That menu looks good to me, would i be able to browse it by useing the arrows ?
    Please don't forget about the menu option that boot to dos with cd-rom support.
    BTW, please don't add "Exit this Menu"...

  6. #6
    Join Date
    Jun 2000
    Posts
    177
    [a bit off topic]
    Do you know where to find the scandisk switches ?
    Would like to set scandisk to scan all partitions on all hdd's (but not devices like cd-rom/cd-rw/dvd-rom)
    [/a bit off topic]

    By the way, thanks alot for helping
    Last edited by BOGIZ; November 1st, 2002 at 07:49 AM.

  7. #7
    Join Date
    Jun 2000
    Posts
    177
    Originally posted by BOGIZ
    [a bit off topic]
    Do you know where to find the scandisk switches ?
    Would like to set scandisk to scan all partitions on all hdd's (but not devices like cd-rom/cd-rw/dvd-rom)
    [/a bit off topic]

    found it, can't see how i could have missed it...
    http://support.microsoft.com/default...;EN-US;q199557

  8. #8
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    > mscdex.exe command switches can be found at ...

    Thanks, but I'm already (too) familiar with MSCDEX.EXE.

    > That menu looks good to me, would i be able to browse it by useing the arrows ?

    No, not with just a BATch file.

    > Please don't forget about the menu option that boot to dos with cd-rom support.

    That option is already part of the WBOOT98SE.EXE boot disk and has not been altered.

    > BTW, please don't add "Exit this Menu"...

    Okay, but, the only way to the DOS prompt then will be to press [Ctrl-C] or [Ctrl-Break] and then answer "Y" to the "Terminate batch job (Y/N)?" prompt.

    Click the following link to download BOGBOOT.EXE (which is a slightly modified version of your WBOOT98SE.EXE).

    http://64.70.165.184/vfrazee/nowonder/files/bogboot.exe
    (866,550 [846K] bytes)

    > Would like to set scandisk to scan all partitions on all hdd's ...

    The command I usually use to do just that is:
    • scandskw /allfixeddisks /noninteractive /silent
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  9. #9
    Join Date
    Jun 2000
    Posts
    177
    Thanks a lot Vernon Frazee for you help. It's much appreciated.
    I hope you don't take this the wrong way. I would like to have the new menu (the one you have written) in the same screen as the the menu with the option for "Start computer with CD-ROM support" (but without "Start computer without CD-ROM support" and "View the Help file", would like to have them deleted).
    Last edited by BOGIZ; November 2nd, 2002 at 08:12 AM.

  10. #10
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    It could be done but, 1) you will only be able to select one option from that menu and 2) the only way back to that menu is to reboot.

    In other words, if you select "with CD-ROM support" you will not be able to then run any of your toolz from the menu. Or, if you select any one of your tools, you will not have access to the CD-ROM drive.

    Is that what you want?
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  11. #11
    Join Date
    Jun 2000
    Posts
    177
    It's Ok if i only can celect one option and have to reboot to get access to the menu again. But i would like to have cd-rom support.

    Wouldn't one be able to add the menu.bat to the autoexec.bat. And then add the menu option to the config.sys, as you can add cdr-rom support for all options there. Would that be a way to go (i don't know if that will work as i have really no know how in this subject)?


    Code:
    [menu]
    menuitem=CD, Start computer with CD-ROM support.
    menuitem=ToolA, Tool 1.
    menudefault=CD,30
    menucolor=7,0
    
    [CD]
    device=himem.sys /testmem:off
    device=oakcdrom.sys /D:mscd001 
    device=btdosm.sys 
    device=flashpt.sys
    device=btcdrom.sys /D:mscd001
    device=aspi2dos.sys
    device=aspi8dos.sys
    device=aspi4dos.sys
    device=aspi8u2.sys
    device=aspicd.sys /D:mscd001
    
    [ToolA]
    device=himem.sys /testmem:off
    device=oakcdrom.sys /D:mscd001 
    device=btdosm.sys 
    device=flashpt.sys
    device=btcdrom.sys /D:mscd001
    device=aspi2dos.sys
    device=aspi8dos.sys
    device=aspi4dos.sys
    device=aspi8u2.sys
    device=aspicd.sys /D:mscd001
    Last edited by BOGIZ; November 2nd, 2002 at 09:22 AM.

  12. #12
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    Like this?

    http://64.70.165.184/vfrazee/nowonder/files/bogboot.exe
    (866,476 [846K] bytes)

    (same link as above)
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  13. #13
    Join Date
    Jun 2000
    Posts
    177
    Yeah, that's whow i want it. But i don't understand why there is a option for "load tools menu" in the main menu. As the other options in the menu links to the tools.
    Would you please add the option for "boot to dos with cd-rom support".
    Does the tools have cd-rom support ? Why i ask is that you have edit out these files in the config.sys file:
    device=himem.sys /testmem:off
    device=oakcdrom.sys /D:mscd001
    device=btdosm.sys
    device=flashpt.sys
    device=btcdrom.sys /D:mscd001
    device=aspi2dos.sys
    device=aspi8dos.sys
    device=aspi4dos.sys
    device=aspi8u2.sys
    device=aspicd.sys /D:mscd001

    If i may push for one more thing, how do one delete the head line "microsoft windows 98 start menu" in the main menu (hope it's not a no no) ?

  14. #14
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    > Would you please add the option for "boot to dos with cd-rom support".

    Done. http://64.70.165.184/vfrazee/nowonder/files/bogboot.exe
    (864,773 [845K] bytes)

    (same link as above)

    > Does the tools have cd-rom support ?

    Yes. Everything in the [COMMON] section of the CONFIG.SYS file gets loaded no matter which option you select.

    > If i may push for one more thing, how do one delete the head line "microsoft windows 98 start menu" in the main menu (hope it's not a no no) ?

    That string is contained within the hidden IO.SYS file. Because this is a program file though, the only way it can be edited is with DEBUG, Hex or Disk Sector Editor. (Note: This is the main Windows 98SE Operating System boot file. Mess it up and there's no telling what might happen).
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  15. #15
    Join Date
    Oct 2000
    Location
    Eeklo, in the East-Flanders
    Posts
    4,974
    Hi

    1; FAIK, one cannot assign a letter to ramdisk.
    But, do you WANT a ramdisk?

    2; if the cdrom has to be assigned letter Z: you should not use the lines M$ uses because this will then be assigned a letter following the first letter after hard disks/ramdisk.

    matter of fact, if you happen to have two atapi devices, you could be better off assigning the letter Q to the first one

    3; you could use JO.SYS or Bart's JO.sys to get the menu "boot from CD, boot from hard disk"

    I got JO.sys off the CD itself by using XCLONE.exe
    you would also get findcd.exe that way...
    I had xclone on my D: drive.
    booted off CD, and ran
    D:\xclone a: b:

    http://members.cox.net/dos/fileuti2.htm
    http://202.37.66.10/downloads/cdrom1/dosutils/

    xclone can be used to copy folders only, but when you do that in REAL MODE DOS, it does not preserve long names.
    (When it is used to clone an entire partition, long names are found intact.)
    I once looked for one that did preserve them when you want to copy folders.
    http://www.odi.ch/prog/lfn/index.php
    GO read that readme... but here is a QUICK TIP...
    for wildcards, use a SINGLE BULLET * and do use /v

    ;-)

    and yes, these are tools I put on my toolz CD
    (along with a cartload of other stuff.)
    you will see I use cc.exe in the autoexec.bat
    cc.exe is yet another tool like xclone...
    I use it to copy the win98 folder over to hard disk

    The trick here is to use findcd.exe

    findcd can be mighty useful for you when you happen to have two atapi devices
    done properly, it puts the cdrom device you booted from in your path, no matter what letter it actually got assigned.
    so, if you used Q, and the device you booted from was assigned R, you'd still be able to find your tools in the path.
    Using this boot method, I actually wind up at the drive containing my CD.

    my tools are in dos8

    you can enhance this method for your menu

    ==============

    for my own use, I made this menu

    [menu]
    menuitem=SETUP_CD, PRE-CONFIGURED Setup from CD-ROM.
    menuitem=CD, Start computer with CD-ROM support.
    menuitem=NOCD, Start computer WITHOUT CD-ROM support.
    menudefault=CD,30
    menucolor=7,0

    [SETUP_CD]
    device=himem.sys /testmem:off
    device=oakcdrom.sys /D:mscd001
    device=aspi8dos.sys
    device=flashpt.sys
    device=aspicd.sys /D:mscd001

    [CD]
    device=himem.sys /testmem:off
    device=A:\EMM386.exe noems
    device=oakcdrom.sys /D:mscd001
    device=flashpt.sys
    device=aspicd.sys /D:mscd001

    [NOCD]
    device=himem.sys /testmem:off
    device=EMM386.exe noems

    [COMMON]
    files=10
    buffers=10
    dos=high,umb
    stacks=9,256

    lastdrive=z

    (not needed for USA)
    device=A:\display.sys con=(ega,,1)
    country=032,850,A:\country.sys
    install=A:\mode.com con cp prepare=((850) A:\ega.cpi)
    install=A:\mode.com con cp select=850
    install=A:\keyb.com be,,A:\keyboard.sys

    ===================
    autoexec.bat
    (i use findcd to get my tools into the path)

    @ECHO OFF
    set EXPAND=YES
    SET DIRCMD=/O:N /W /P

    IF "%config%"=="NOCD" GOTO QUIT

    cls
    set temp=c:\
    set tmp=c:\
    LH MSCDEX.EXE /D:mscd001 /L:Q
    set CDROM=FOO23
    FINDCD.EXE
    if "%CDROM%"=="FOO23" goto NOCDROM
    set Path=A:\;C:\;%CDROM%\;%CDROM%\dos8\;
    %CDROM%
    echo.

    IF "%config%"=="SETUP_CD" goto AUTOSETUP
    GOTO QUIT

    :AUTOSETUP
    set CDROM=FOO23
    FINDCD.EXE
    if "%CDROM%"=="FOO23" goto NOCDROM
    path=a:\;%CDROM%\
    %CDROM%
    A:\cc \WIN98 C:\WIN98 /b /r+ /u /s
    echo.
    c:\WIN98\SETUP.EXE PRESET.INF /NF /NTLDR /is /iv /p j /d
    goto QUIT



    :NOCDROM
    echo.
    echo Windows 98 Setup.exe was not found
    echo.


    :QUIT
    =================

    I used this for autosetup, it works like a charm
    findcd looks for win98\setup.exe

    when it finds it, it knows what drive to use for %cdrom%

    findcd.exe can be made to look for other file by using a hexeditor
    (I have made ghost recovery cdroms that way)

    Happy batching.

    (sorry about the edit... lastdrive line was missing >> see later comments.)
    Last edited by jtdoom; November 3rd, 2002 at 06:43 PM.
    Kind regards, Jaak.

    When I pull my bootstraps, why don't I load Windows?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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