Menu

HOW TO CHANGE COMMAND.COM

Advanced
2017-05-15
2017-05-15
  • sezer yazicioglu

    Hello,

    I have an old software wich looks for command.com for work i used to start the software on dosbox with changing the COMSPEC variable to use it with my command.com due to lack of printing ability in dosbox i want to use vDos but i can not change COMSPEC variable is there a way to change it ?

    I repeat the software look specifically for COMMAND.COM and gets whatever informations from there the 4dos or other commands does not work.

    Thank you

     

    Last edit: sezer yazicioglu 2017-05-15
    • Jos Schaars

      Jos Schaars - 2017-05-15

      You change the COMSPEC environment variable by SET COMSPEC=. What’s so special about your command.com?
      If you want to use that one, and your program uses the COMSPEC variable, you would have to rename it and set COMSPEC accordingly.

      Jos

       
  • sezer yazicioglu

    Hello jos,

    there is nothing special about it its just from win98 dos but the software has to see it to work properly

    I did changed it the way you said before and i tried it now too but no luck its not working..

    If i do it on normal dosbox its working..

    edit: i have renamed it too.. no work sorry..

    edit2: debug with other dosbox variants as 4dos

    3577760862: EXEC:Parsing command line: pd
    3577760865: EXEC:Execute pd.EXE 0
    3577760865: FILES:file open command 0 file pd.EXE
    DOS_AllocateMemory(blocks=0x000b) = 0x0171-0x017b
    DOS_AllocateMemory(blocks=0x6611) = 0x017d-0x678d
    3578052564: FILES:file create attributes 0 file LPT1

    i read somewhere on the internet that this call is illegal path and its something to do with comspec
    maybe 4dos uses different comspec still after i changed the comspec variable?

    btw the same command.com file is working on a untouched dosbox 0.74...

     

    Last edit: sezer yazicioglu 2017-05-15
    • Jos Schaars

      Jos Schaars - 2017-05-16

      Like your PD.EXE program, COMMAND.COM and 4DOS.COM are external DOS programs. The latter two are used to execute DOS commands and batch files, while PD.EXE will do something completely different. If PD.EXE for instance needs to execute a batch file (it can't do that itself), it should first (DOS programs however not always do) inspect the value of the COMSPEC environment variable; what command processor program to use. PD.EXE will then call DOS API to start that program.

      vDos has no external COMMAND.COM. But a command processor is of course needed, else AUTOEXEC.BAT couldn’t even be executed. Instead vDos uses 4DOS.COM. If you do a DIR you won’t see 4DOS.COM, though there seems to be a COMMAND.COM. 4DOS.COM is built into vDos, COMMAND.COM is faked to be present since some (simple, very old) DOS programs test for that. If a program calls DOS API to execute COMMAND.COM, actually 4DOS.COM is started by vDos.

      The COMSPEC variable has no meaning to COMMAND.COM or 4DOS.COM (besides starting a second instance of themselves), merely to your program if it indeed inspects its value to determine what command processor to start if needed. No idea why your program has to “see” the command processor file on disk; if it wouldn’t be there, the program couldn’t be started at all. Your program only worked in DOSBox by copying the Win98 COMMAND.COM to DOSBox C:? Then it seems your program neglects COMSPEC inspecting C:\COMMAND.COM only (for its size?). Plain silly, and that won’t work in vDos, since that reports a different (faked) C:\COMMAND.COM.

      If you refer to “create attributes 0 file LPT1” being illegal: Nothing wrong with that, creating a DOS device is the same as opening it. That moment your program is running (not COMMAND.COM or 4DOS.COM), any link to COMSPEC is unclear to me.

      Jos

       
  • sezer yazicioglu

    Btw i forgot to mention that in the first try to run the software if the command.com is in place the software creates a file in the same folder of command.com with the name 8632ANSI.SET.

    i am getting the “create attributes 0 file LPT1” while i changed compsec with mine. This error is only the beginning after that i get many errors just not with LPT1 other file names there..

    I just started to work on it again.. to solve it if you have any clues i would appreciate

    thank you

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.